Stop consuming messages. Close the channel once all pending message handlers have settled. If called while the Connection is reconnecting, then this may be delayed by ConnectionOptions.acquireTimeout
Alias for RPCClient#send
Like Channel#basicPublish, but it resolves with a response message, or rejects with a timeout. Additionally, some fields are automatically set:
Send directly to a queue. Same as send({routingKey: queue}, body)
See
This will create a single "client"
Channel
on which you may publish messages and listen for direct responses. This can allow, for example, two micro-services to communicate with each other using RabbitMQ as the middleman instead of directly via HTTP.If you're using the createConsumer() helper, then you can reply to RPC requests simply by using the
reply()
argument of the ConsumerHandler.Also, since this wraps a Channel, this must be closed before closing the Connection:
RPCClient.close()
Example
If you're communicating with a different rabbitmq client implementation (maybe in a different language) then the consumer should send responses like this: