azure-sdk-for-cpp icon indicating copy to clipboard operation
azure-sdk-for-cpp copied to clipboard

How to pull messages from a Service Bus Queue

Open user3472g opened this issue 2 years ago • 1 comments

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

user3472g avatar Jan 11 '23 21:01 user3472g

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.

Jinming-Hu avatar Jan 12 '23 04:01 Jinming-Hu

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.

github-actions[bot] avatar Aug 08 '24 23:08 github-actions[bot]

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.

github-actions[bot] avatar Aug 16 '24 04:08 github-actions[bot]