-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sender updates #11580
Sender updates #11580
Conversation
JoshLove-msft
commented
Apr 24, 2020
•
edited
Loading
edited
- Add ServiceBusSenderOptions
- Rename SendBatchAsync -> SendAsync
/azp run net - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
ValidateEntityName(options?.ViaQueueOrTopicName); | ||
ValidateEntityName(queueOrTopicName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't call ValidateEntityName
method for queueOrTopicName
and ViaQueueOrTopicName
both. Think about if user passes EntityPath with connection string, then one of the above method will fail because we check in ValidateEntityName
method that if the entity path specified in both(Connection.EntityPath
and entityName
) with different value then it will throw an exception.
if (!string.IsNullOrEmpty(Connection.EntityPath) && !string.Equals(entityName, Connection.EntityPath, StringComparison.InvariantCultureIgnoreCase))
{
throw new ArgumentException(Resources.OnlyOneEntityNameMayBeSpecified);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if they pass an entity name in the connection string that means they won't be able to use SendVia, since they are restricted to that one entity. So in this case we would want to throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you forget to update this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
/// A set of <see cref="ServiceBusMessage" /> with size constraints known up-front, | ||
/// intended to be sent to the Queue/Topic as a single batch. | ||
/// A <see cref="ServiceBusMessageBatch"/> can be created using | ||
/// <see cref="ServiceBusSender.CreateBatchAsync(System.Threading.CancellationToken)"/>. | ||
/// Messages can be added to the batch using the <see cref="TryAdd"/> method on the batch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add this Messages can be added to the batch using the <see cref="TryAdd"/> method on the batch
for CreateBatchAsync
docs as well?
/// <param name="options">The set of <see cref="ServiceBusClientOptions"/> to use for configuring | ||
/// this <see cref="ServiceBusClient"/>.</param> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ServiceBusClientOptions
-> ServiceBusSenderOptions
and ServiceBusClient
-> ServiceBusSender
@@ -216,7 +216,7 @@ messageBatch.TryAdd(new ServiceBusMessage(Encoding.UTF8.GetBytes("First"))); | |||
messageBatch.TryAdd(new ServiceBusMessage(Encoding.UTF8.GetBytes("Second"))); | |||
|
|||
// send the message batch | |||
await sender.SendBatchAsync(messageBatch); | |||
await sender.SendAsync(messageBatch); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update SendBatchAsync -> SendAsync in the Sending messages section and in the description of Sending and receiving batch of messages?
611eab4
to
c391cc0
Compare