mateodelnorte / servicebus

Simple service bus for sending events between processes using amqp.
MIT License
420 stars 66 forks source link

use of enableConfirms option #62

Closed pawelbaranski closed 8 years ago

pawelbaranski commented 8 years ago

Hi

I am trying to use enableConfirms options with callback on send and I am getting and error that options is not set so I can't use the callback

//...
var bus = require('servicebus').bus({ url: busUrl, enableConfirms: true });

bus.send('test', { xxx: 'yyy'}, function (err) {
  console.log(err);
});

output [Error: callbacks only supported when created with bus({ enableConfirms:true })]

am I missing something ?

mateodelnorte commented 8 years ago

This is a bug. The check for initialized should happen after the check for confirms. I can fix and publish an update tonight. Thanks for the find. On Feb 5, 2016 1:50 PM, "Paweł Barański" notifications@github.com wrote:

Hi

I am trying to use enableConfirms options with callback on send and I am getting and error that options is not set so I can't use the callback

//...var bus = require('servicebus').bus({ url: busUrl, enableConfirms: true }); bus.send('test', { xxx: 'yyy'}, function (err) { console.log(err); });

output [Error: callbacks only supported when created with bus({ enableConfirms:true })]

am I missing something ?

— Reply to this email directly or view it on GitHub https://github.com/mateodelnorte/servicebus/issues/62.

pawelbaranski commented 8 years ago

I'd really appreciate this, thanks

mateodelnorte commented 8 years ago

Hi @pawelbaranski. I've made #63 to fix this issue. I'm on vacation at the moment. Want pull that branch, test to confirm it fixes your issue and then I'll publish tonight?

git clone the repo to another directory, checkout that branch, then npm link it to your project. You'll be able to use it directly.

mateodelnorte commented 8 years ago

servicebus now published to version 1.0.20 with this fix included. ;)

pawelbaranski commented 8 years ago

nice :+1: :)