Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle method.basicCancel #52

Closed
AVVS opened this issue Jan 14, 2016 · 3 comments
Closed

Handle method.basicCancel #52

AVVS opened this issue Jan 14, 2016 · 3 comments

Comments

@AVVS
Copy link
Contributor

AVVS commented Jan 14, 2016

When we have the following options and #51 is merged in consumer gets new events

{
      host: 'localhost',
      port: 5672,
      login: 'guest',
      password: 'guest',
      vhost: '/',
      temporaryChannelTimeout: 6000,
      clientProperties: {
        capabilities: {
          consumer_cancel_notify: true,
        },
      },
},

Example log:

  amqp:AMQPParser 2 > method basicCancel {"consumerTag":"Vitalys-iMac.local-30767-1452811088079","noWait":1} +20s
  amqp:Consumer onMethod basicCancel, {"consumerTag":"Vitalys-iMac.local-30767-1452811088079","noWait":1} +1ms

It would be nice to have https://github.com/dropbox/amqp-coffee/blob/master/src/lib/Consumer.coffee#L196 extended with a handler for such an event (https://www.rabbitmq.com/consumer-cancel.html). It could simply emit an event, which a user must handle, or automatically try to reconnect. To synthetically generate such an event - create a consumer and then purge queue/exchange in the rabbitmq management console

AVVS added a commit to microfleet/transport-amqp that referenced this issue Jan 14, 2016
It doesn't do much, because all of these events are generally triggered by a publisher, but it's a good example
of how error handling should be done. Start working on consume cancel notification.
Requires dropbox/amqp-coffee#52 to be completed
@barshow
Copy link
Contributor

barshow commented Jan 14, 2016

What would you want it to do? I suppose emitting an error on the consumer could work?

@AVVS
Copy link
Contributor Author

AVVS commented Jan 14, 2016

Maybe another kind or event such as 'cancel'? Error would, of course, work, but then we'll have to choose error code, structure it similarly to rabbitmq response, and this is likely undesirable

On 15 Jan 2016, at 01:53, David Barshow notifications@github.com wrote:

What would you want it to do? I suppose emitting an error on the consumer could work?


Reply to this email directly or view it on GitHub.

@barshow
Copy link
Contributor

barshow commented Jan 14, 2016

yeah, i really hate adding random emitters, everything but errors are callback based. I think ill add the cancel listener and fall back to error if there isn't a cancel listener.

@barshow barshow closed this as completed Jan 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants