EventHub for Windows Azure
npm install eventhub-js
EventHub JS is a simple integration for Azure Eventhubs.
Event Batching support is built in from the start!
``js`
npm install eventhub-js
`js
const eventhub = require('eventhub-js');
const TOKEN = eventhub.createSASToken(eventhubNamespace, eventhubHubName, key, keyName);
const CLIENT = new eventhub.EventHubClient(TOKEN, {
// Defaults:
batching: true,
batchSize: (1025 * 200),
intervalTimer: 20
});
// Inherit from this class, to whatever is needed for your eventhub
let event = new eventhub.EventHubEvent();
CLIENT.send(event).then((result: boolean) => {
// No return
}).catch((err) => {
// Handle your error
});
`
EventhubJS uses events to report on its status
`js
CLIENT.on('sendBatch', () => {
});
`
added - An Event got added to its batchsendBatch - Batch was sent to EventhubinvalidToken - Authentication Rejected for SASTokenhttpErr` - STATUSCODE - HTTP Error when sending events to eventhub