Closed ietz closed 2 days ago
Thank you for your feedback. Tagging and routing to the team member best able to assist.
@ietz apologies for the delay on this one. The reason for the split is not entirely clear and perhaps lost to time ( with team changes etc etc )
With that said I was looking at our code to see if a nicer workaround would be available in your case and there is - with the way urls and the service structures entities you can pass in a queue name or a topic name into the sender ( either topic sender or queue sender ) and it will work.
I tested this with a sample - typed in my topic name in to get_queue_sender
and the messages landed in the topic and showed up in my subscription. Tried it the other way and the messages showed up in my queue.
We will look in to potentially adding an overload in the future but given how long these APIs have been around might need some further thinking.
In the mean time hopefully this workaround works.
Hi @ietz. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.
Hi @ietz, since you haven’t asked that we /unresolve
the issue, we’ll close this out. If you believe further discussion is needed, please add a comment /unresolve
to reopen the issue.
Is your feature request related to a problem? Please describe. I would like a way to send messages to an Azure Service Bus entity without needing to know in advance if the entity is a topic or a queue. Currently, the only way to send a message is by first creating a
ServiceBusClient
and using its.get_queue_sender
or.get_topic_sender
method to get aServiceBusSender
instance and then using its.send_messages
method.Having to know the type in advance limits the usefulness of the message
ReplyTo
property for a request-response pattern where some of the responses need to be delivered to a queue while others need to be delivered to a topic.Describe the solution you'd like Merge the
.get_queue_sender
and.get_topic_sender
methods into a.get_sender
method that takes a sharedqueue_or_topic_name: string
parameter, instead of having separate methods or parametersqueue_name: string
andtopic_name: string
. As far as I can tell from the docs, this is exactly what the Service Bus .NET SDK does with theServiceBusClient.CreateSender(string queueOrTopicName)
method.Describe alternatives you've considered Two potential solutions that would work with the current SDK:
ReplyTo
property. Instead of aReplyTo = 'response'
, set the value to'queue/response'
or'topic/response'
.get_queue_sender
to send the reply first. If this throws an error, retry with.get_topic_sender
.Both should work but seem like workarounds and should not be necessary given that the .NET API does not have these limitations