-
Notifications
You must be signed in to change notification settings - Fork 14
Use new Azure ServiceBus library that can create queues #13
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
Use new Azure ServiceBus library that can create queues #13
Conversation
| #if NETSTANDARD2_0 | ||
| try | ||
| { | ||
| managementClient.QueueExistsAsync(queueName) |
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.
@mythz wouldn't mind some guidance on how you'd like to see this part done. All management apis are async so went this route for now
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.
The async method would normally be propagated back to the public API which would return a Task Response. But if you want to keep the different implementations the same as the sync API you would block and call .Wait() and .Result however this opens the chance of a deadlock.
To best mitigate the changes, ideally registering queue's would only be done at registration for all the registered queue's when the MQ is started.
| #if !NETSTANDARD2_0 | ||
| protected internal readonly NamespaceManager namespaceManager; | ||
| #endif | ||
| #if NETSTANDARD2_0 |
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.
use #else instead of repeating the negative condition
|
updated all occurrences, thanks!
…On Wed, Jul 4, 2018 at 9:49 PM, Demis Bellot ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/ServiceStack.Azure/Messaging/ServiceBusMqMessageFactory.cs
<#13 (comment)>
:
> @@ -19,6 +20,9 @@ public class ServiceBusMqMessageFactory : IMessageFactory
#if !NETSTANDARD2_0
protected internal readonly NamespaceManager namespaceManager;
#endif
+#if NETSTANDARD2_0
use #else instead of repeating the negative condition
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0VCTcKL9d7JfHX4HNW2OIy8XkWsEOVks5uDWKPgaJpZM4VC6gt>
.
|
|
Makes sense, I'll update the code. I'm using the RabbitMQ implementation as
a reference and was wondering when/where do the <dto>response queues get
created?
…On Wed, Jul 4, 2018 at 10:00 PM, Demis Bellot ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/ServiceStack.Azure/Messaging/ServiceBusMqMessageFactory.cs
<#13 (comment)>
:
> sbClient = sbClients.GetOrAdd(queueName, sbClient);
return sbClient;
}
+
+ protected internal QueueDescription RegisterQueueByName(string queueName)
+ {
+ var mqDesc = new QueueDescription(queueName);
+#if !NETSTANDARD2_0
+ if (!namespaceManager.QueueExists(queueName))
+ namespaceManager.CreateQueue(mqDesc);
+#endif
+#if NETSTANDARD2_0
+ try
+ {
+ managementClient.QueueExistsAsync(queueName)
The async method would normally be propagated back to the public API which
would return a Task Response. But if you want to keep the different
implementations the same as the sync API you would block and call .Wait()
and .Result however this opens the chance of a deadlock.
To best mitigate the changes, ideally registering queue's would only be
done at registration for all the registered queue's when the MQ is started.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA0VCdEqUFV44wIW3qB0W3_PfErHkPokks5uDWVBgaJpZM4VC6gt>
.
|
|
It's created on |
|
I’ve neglected this due to work commitments and found an issue that I’ll need to spend time resolving. So closing for now and will send a new PR. |
All MQ tests run and pass (except for ignored test)