azure-sdk-for-cpp
azure-sdk-for-cpp copied to clipboard
How to pull messages from a Service Bus Queue
Query/Question
I am receiving errors attempting to access a Service Bus Queue using the C++ SDK. I would like someone to review the below and tell me if what I am trying to do is possible.
Why is this not a Bug or a feature Request?
I did not file this as a bug as this may be user error. Like wise, it is why I did not file a feature request.
Setup (please complete the following information if applicable):
- OS: Ubuntu 20
- SDK Version: Core 1.7.1
std::string connectionString{"Endpoint=sb://myservicebus.servicebus.windows.net/;SharedAccessKeyName=ARWPolicy;SharedAccessKey=8888BBBBBBBBBBBQndH8xQHKzSXXXXXXXXXXXXXXE=;EntityPath=myqueue" };
auto qc = QueueClient::CreateFromConnectionString(connectionString, "myqueue");
auto result = qc.ReceiveMessages({1,std::chrono::seconds(30)}).Value;
While the name of the Service Bus, the Queue, and the Key have been altered here, in the code, the ConnectionString that is used is pulled from the Azure Portal for the Service Bus Queue.
The following exception occurs:
HTTP Transport Exception Fail to get a new connection for: ://. URL using bad/illegal format or missing URL
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [* ] Query Added
- [* ] Setup information Added
This is storage queue, not service bus queue. Refer to this link for the difference https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-azure-and-service-bus-queues-compared-contrasted
Service bus is not yet available in C++ SDK.
Hi @user3472g. 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 @user3472g, 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.