An e-commerce or financial system uses RocketMQ transactional messages to coordinate order placement with OceanBase distributed transactions, then upon successful commit, routes the order confirmation event through EventBridge's API destination to Twilio for reliable multi-channel customer notification (SMS, voice, WhatsApp).
Use this pipeline when building order-processing or financial systems that require strict consistency between database state changes and customer communications. It ensures notifications are only dispatched after OceanBase distributed transactions successfully commit, leveraging RocketMQ’s two-phase messaging and EventBridge’s API routing to guarantee delivery without manual reconciliation.
BEGIN;). Send a RocketMQ half-message via Java SDK: producer.sendMessageInTransaction(msg, localExecuter, arg).executeLocalTransaction(), run OceanBase SQL (INSERT INTO orders...; UPDATE inventory...). Return TransactionStatus.COMMIT on success, ROLLBACK on failure.checkLocalTransaction() to query OceanBase for transaction state. Return COMMIT if the order exists, else ROLLBACK.https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json. Attach an IAM role with events:InvokeApiDestination and configure Basic Auth using Twilio credentials.{"source": ["ecommerce.orders"], "detail-type": ["order.confirmed"]}. Set the target to your Twilio API Destination.{"To": "<customer_phone>", "From": "<twilio_number>", "Body": "Order #<order_id> confirmed."}.201 Created and track MessageSid in Twilio’s dashboard.The app initiates an OceanBase transaction and sends a RocketMQ half-message. Upon DB commit, RocketMQ finalizes the message. EventBridge routes the committed event via an API Destination to Twilio’s REST endpoint, triggering multi-channel dispatch. OceanBase manages state consistency, RocketMQ guarantees transactional delivery, EventBridge decouples routing, and Twilio executes notifications.
events:InvokeApiDestinationcheckLocalTransaction() causes RocketMQ to auto-rollback unverified messages after 15s, dropping notifications.AccountSID:AuthToken). Omitting this in the API Destination connection triggers 401 Unauthorized.order_id as a deduplication key or enable Twilio’s StatusCallback for idempotency.Q: How does the distributed transaction pipeline coordinate order processing and send customer notifications? A: The pipeline uses RocketMQ transactional messages to coordinate order placement with OceanBase distributed transactions, then routes the confirmed event through EventBridge to Twilio for multi-channel delivery. This architecture ensures reliable order processing by triggering SMS, voice, or WhatsApp alerts only after a successful database commit.