DATAGO-74463: Add Dynamic Producer Destination to the binder #39839
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
##Overview
This pull request introduces a change to enable Dynamic Producer Destination functionality in the Azure ServiceBus Binder. This feature allows users to specify message destinations dynamically at runtime by using the AzureHeaders.Name.
##Motivation
Currently, the ServiceBus Binder utilizes the DefaultMessageHandler which supports dynamic destination routing through the AzureHeaders.NAME header. The destination is determined based on the presence of this header in a message (LINK):
However, despite being able to specify a dynamic destination, the message production fails if the DefaultEntityType is not pre-set. This is because the system does not know the entity type (queue or topic) of the destination, and it checks for this setting here (LINK):
Without a default entity type, the producer creation process fails even if the destination name is dynamically provided.
##Solution
To resolve this issue, I have implemented a change to set the DefaultEntityType accordingly to the entity type specified in the workflow configuration by the user. This ensures that the dynamic destination feature can function correctly and the message to routed properly.
----------------------------------------------------------------//----------------------------------------------------------------
If an SDK is being regenerated based on a new swagger spec, a link to the pull request containing these swagger spec changes has been included above.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines