node-amqp-connection-manager icon indicating copy to clipboard operation
node-amqp-connection-manager copied to clipboard

consume() method is missing from channelWrapper

Open syberkitten opened this issue 6 years ago • 3 comments

Looks like the channelWrapper is missing the consume method.

Only the inner AMQP channel has the consume method, but it is not available on the wrapper, is this by design?

Looks like it can be accessed via: channelWrapper._channel.consume

same goes for "reject" which is also missing.

syberkitten avatar Feb 03 '19 12:02 syberkitten

The issue is really that i need to have the ChannelWrapper inside the consume message method so it would be possible to ack / reject messages.

The problem is that the ChannelWrapper is created after all the channel asserts / consume are set up thus it's not available, which causes many side effects.

when i try to work around it, the re-connect feature is not working properly, the connection re-connects but the channel is not re-created so messages are not received.

syberkitten avatar Feb 04 '19 10:02 syberkitten

ChannelWrapper will be created before your setup function is called for the first time. This means you can use channelWrapper inside the setup function if you need to.

FINDarkside avatar Feb 15 '19 11:02 FINDarkside

I agree to have consume method on channelwrapper which would make calling consume method outside of setup possible. As of now we need to make consume method call from setup itself

reachmehere89 avatar Apr 27 '19 17:04 reachmehere89