Azure / azure-service-bus

☁️ Azure Service Bus service issue tracking and samples
https://azure.microsoft.com/services/service-bus
MIT License
580 stars 775 forks source link

Inquiry on Transactional Request-Response over AMQP #657

Closed minghuaw closed 10 months ago

minghuaw commented 1 year ago

Description

There currently is no official protocol that defines how transaction works on an AMQP management link (ie. the request-response link). What is the frame exchange model that Service Bus uses for transactional request-response operations?

I have taken a look at the .net sdk where it seems like it is composed of a transactional posting on the sender and then a non-transactional receive on the receiver. However, the disposition frame sent back by Service Bus after the transactional posting message transfer does not seem to be compliant to the AMQP core spec.

Actual Behavior

  1. A Disposition frame carried a non-transactional delivery state. For example
Transaction Controller                  Transactional Resource
===============================================================================

TRANSFER(handle=1,           --------->
         delivery-id=1,
         state=
           TransactionalState(
             txn-id=0) )
{ ... payload ... }

                             <--------- DISPOSITION(first=1, last=1, state=Accepted())
-------------------------------------------------------------------------------

Expected Behavior

  1. The disposition frame, to my understanding, should carry a transactional delivery state as the quote below is stated in the core spec

When traveling in the other direction, from resource to controller, the transfer and disposition frames indicate work performed, and the txn-ids included MUST correctly indicate with which (if any) transaction this work is associated.

So I was expecting the following

Transaction Controller                  Transactional Resource
===============================================================================

TRANSFER(handle=1,           --------->
         delivery-id=1,
         state=
           TransactionalState(
             txn-id=0) )
{ ... payload ... }

                             <--------- DISPOSITION(first=1, last=1,
                                                    state=TransactionalState(
                                                            txn-id=0,
                                                            outcome=Accepted())
                                                   )
-------------------------------------------------------------------------------
yvgopal commented 10 months ago

Request-Response link is not part of the official AMQP spec. So it currently doesn't participate in transactions. And we don't have any plans of adding that support. As far as discrepancies w.r.t the spec itself in the current implementation, we will track this item and see what we can do about it. As I see in the code, we do send txn-id back in the disposition frame too. May be that disposition is not participating in the transaction. I am closing this ticket now. If you have a consistent repro for it, please reopen the ticket and we will fix it.

minghuaw commented 10 months ago

@yvgopal Can you verify that the disposition indeed carries a transactional state as defined in the spec (http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-transactions-v1.0-os.html#type-transactional-state)? I don't remember what exactly was received given that this issue has been over 6 months, but I think what happened was that a non-transactional state was sent instead of transactional state