EventHubs support for Azure ServiceBus JavaScript SDK

Damir Dobric Posts

Next talks:



Follow me on Twitter: #ddobric




We published new version of Azure Service Bus Java Script SDK v1.2. This version provides supports for sending of events to Azure Service Bus Event Hubs.


Supported features:

  • Sending of messages to the queue
  • Reading of messages from queue
  • Sending of messages to Topic
  • Sending of events to EventHub (NEW)
  • Reading of messages from subscription
  • Abondon
  • PeekLock-Read/PeekDelete-Read
  • Complete
  • Creating Shared Access Token Signatures
  • Custom BrokeredMessage properties
  • CORS

Following sample shows how to send an event to Service Bus Event Hub.

   <script type="text/javascript">
function () {

var clear = function () {


var ehubClient = new EventHubClient(
: ‘eintrachtfrankfurt’,

               // This is by spec a partition key if specified.
'devicename': 'jssimulator',

'namespace': "mynamespace",
'sasKey': "Hakan:)**/bU="
'sasKeyName': "send_events"
: 10,


"#btnSend").click(function () {

var eventBody = { "24": txtTemp.value,
: “Frankfurt am Main”};

var msg = new EventData(eventBody);

        ehubClient.sendMessage(msg, function (messagingResult) {


Open Source Project on GitHub.

Nuget Packages sbjssdk 1.2.0 and sbjssdk 1.2.0 samples.

Related Samples:

1. How to send messages to Service Bus from .NET Microframework (Example Gadgeteer SPIDER):

2. How to build SharePoint and Office 365 Apps which send messages to Service Bus and consume device events in JavaScript Microservice on top of Service Bus messaging.

3. EventHubDashDemo provides code to visualize how Azure Event Hubs enables very large scale data ingestion from a large number of sources and very high throughput event consumption through the use of partitioned consumers.

Related Articles

1. Introduction in SBJSSDK:

2. Jumpstart SBJSSDK

Posted Jan 26 2015, 10:29 PM by Damir Dobric
developers.de is a .Net Community Blog powered by daenet GmbH.