Permalink
Browse files

Pass raw options object to communications pipeline

  • Loading branch information...
christav committed Mar 16, 2013
1 parent d36356e commit 38b12607c611f6c33a03a71521d2be53e0e2881d
Showing with 8 additions and 16 deletions.
  1. +8 −15 lib/sbstore.js
  2. +0 −1 lib/servicebusconnector.js
View
@@ -128,23 +128,16 @@ ServiceBusStore.prototype.createServiceBusConnector = function createServiceBusC
}
if (options.connectionString) {
- this.serviceBusService = azure.createServiceBusService(options.connectionString);
- } else {
- this.serviceBusService = options.serviceBusService;
+ options.serviceBusService = azure.createServiceBusService(options.connectionString);
}
- var createOptions = {
- nodeId: this.nodeId,
- topic: options.topic,
- subscription: options.subscription,
- serviceBusService: this.serviceBusService,
- numReceives: options.numReceives,
- logger: this.log
- };
-
- return new MessageBatcher(createOptions,
- new MessageSequencer(createOptions,
- new ServiceBusConnector(createOptions)));
+ this.serviceBusService = options.serviceBusService;
+ options.logger = this.log;
+ options.nodeId = this.nodeId;
+
+ return new MessageBatcher(options,
+ new MessageSequencer(options,
+ new ServiceBusConnector(options)));
}
ServiceBusStore.prototype.hookupListeners = function (listeners) {
@@ -89,7 +89,6 @@ ServiceBusConnector.prototype.send = function (name, args) {
var self = this;
var message = this.packMessage(name, args);
this.serviceBusSender.sendTopicMessage(this.topic, message, function (err) {
-
if (err) {
self.emit('sberror', new Error('Failed to write to service bus on topic %s, err = %s', self.topic, util.inspect(err)));
}

0 comments on commit 38b1260

Please sign in to comment.