0

I have a Azure Service Bus Topic and I want to receive the messages in realtime on a web page that uses pure Javascript.

I tried this SDK (http://developers.de/blogs/damir_dobric/archive/2015/01/26/eventhubs-support-for-azure-servicebus-javascript-sdk.aspx) but when I speed up the sending message not worked well.

I tried too REST API but not worked well too.

Exist any alternative?

Regards

Jorge Rosa
  • 63
  • 1
  • 8
  • There is no official Azure Service Bus front-end javascript SDK. Could you share the code that you have written work with Service Bus via REST API? – Aaron Chen Apr 10 '17 at 10:29
  • @AaronChen-MSFT I tried JQuery GET like this to receive my messages: $.get("https://.servicebus.windows.net//subscriptions//messages/head/", function(data, status) { console.log("Data: " + data + " | Status: " + status); }); – Jorge Rosa Apr 10 '17 at 17:44

2 Answers2

0

It requires an Authorization request header to receive the messages from a queue or subscription via REST API. The value of the header could be a SAS token or a SimpleWebToken acquired from ACS.

About how to generate a Shared Access Signature (token), you can check out this link. For request a Token from ACS, please refer to this article.

Aaron Chen
  • 9,835
  • 1
  • 16
  • 28
  • Thanks. I read the info that you sent, but already I have some technical questions. How I can develop the Receive and Delete message in Javascript? I can find some JS functional examples/samples – Jorge Rosa Apr 12 '17 at 20:02
0

I know it is a late reply, but just in case somebody is looking to use Azure SDK for JS libraries on a website, you need to convert your code to work inside the browser. You can do this using bundler such as rollup, webpack, parcel, etc. Refer to this bundling docs to use the @azure/service-bus library in the browsers.

High performant version 7.0.0 @azure/service-bus library based on AMQP protocol has been recently published. Refer to the links below.