test queue and topic send using CreateMessageBatchAsync to avoid management grants #2459
+503
−97
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.
feat: test queue and topic send using CreateMessageBatchAsync to avoi…
What this PR does / why we need it:
This PR introduce a way to test topic or queue using send grant to avoid that we force to provide management roles to implement the hc
Which issue(s) this PR fixes:
Please reference the issue this PR will close: #555
Please reference the issue this PR will close: #727
Special notes for your reviewer:
i'm leveraging CreateMessageBatchAsync since it does a network call to the Service Bus to fetch entity properties, such as MaxMessageSize.
Therefore, it verifies:
It does NOT send messages, so no DLQ or queue pollution occurs
Potentially could be possible also to use a probe message to verify that the configuration of the message is valid.
Sample
Does this PR introduce a user-facing change?:
Yes.
For the queue, since queue can be consumed in both SEND and LISTEN mode, to mirror existing implementation i've set UseCreateMessageBatchAsyncMode = true as default.
This implies that if you want to test only LISTEN, is mandatory to explicitely set configure in AddAzureServiceBusQueue call, to maintein the same behaviour of current implementation, like:
Please make sure you've completed the relevant tasks for this PR, out of the following list: