简体   繁体   中英

Azure Service Bus - Is EnableCrossEntityTransactions necessary for forwarding messages within subscriptions under the same topic?

I've read all the documentation I could find and this case is still not clear to me. When I receive a message from subscription A and then use a transaction to complete the message and send a new message to the same topic (but to a different subscription), is it necessary to configure the Service Bus client with EnableCrossEntityTransactions?

The flow:

  1. Receive message M1 from subscription A (topic T1)
  2. Start transaction
  3. Complete message M1
  4. Send message M2 to topic T1 (will be routed to subscription B)

While the subscription used to receive is under the same topic used to dispatch to, those are two different entities.

If you want to ensure completion of M1 and dispatching of M2 are happening atomically, succeed or or rolled back together, a transaction is necessary and the option EnableCrossEntityTransactions is required. Otherwise, you're risking completing the incoming M1 message without successfully dispatching M2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM