Skip to content

Deprecate "send via" and allow implicit transactional via sender and receiver - #16942

Closed
bainian12345 wants to merge 1 commit into
Azure:masterfrom
bainian12345:bailiu/deprecate-send-via
Closed

Deprecate "send via" and allow implicit transactional via sender and receiver#16942
bainian12345 wants to merge 1 commit into
Azure:masterfrom
bainian12345:bailiu/deprecate-send-via

Conversation

@bainian12345

Copy link
Copy Markdown
Contributor

The objective of this PR is to deprecate the "send via" API and maintain the functionality by implicitly inferring the send via entity from the server side. This is how the new model would work:

  • The user must declare the TransactionContext before creating any sender or receiver they intend to use for transational send via.
  • When the user creates the transactional sender/receiver, they must include the TransactionContext as part of the new API.
  • The queue/topic of the first transactional sender/receiver will implicitly become the "via" entity for that transaction. If it's a receiver for a subscription, its corresponding topic will be chosen instead.
  • All subsequent senders will send via the chosen "via" entity, similar to the existing mechanism, allowing for cross-entity transactions.
  • Either sender or receiver is allowed as the first client on the transaction to be used to establish the "via" entity, but all subsequent clients must be senders (otherwise it would result in "receive via") unless the receiver has the same top level entity as the "via" entity. Violations would result in exception from server.
  • All transactional actions (send, complete, deadletter, etc.) from the transactional sender/receiver created using this new API would automatically be stamped with the transaction ID from the associated TransactionContext. If transaction is undesired, please do not create the sender/receiver using the new transactional API.

As part of the implementations brought by this PR, here are some other changes:

  • Amqp Session objects are no longer created for each sender/receiver. Each MessagingFactory will create an Amqp Session, and all its non transactional senders/receivers will share the same session and only create their individual Amqp Link.
  • Each TransactionContext will create its own Amqp Session, and the transactional senders/receivers will create Amqp Link objects on the Amqp Session of their associated TransactionContext.
  • Controller objects now have 1-to-1 mapping with TransactionContext, and MessagingFactory will not contain multiple Controller objects. The controller objects are tracked by a Map in MessagingFactory, where the key is the transactionId.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant