Open sossnowski opened 1 year ago
RabbitMQ has a store-and-forward semantic (as do similar alternatives). This means the message is acknowledged when RabbitMQ receives it, not when that message is then forwarded to a consumer.
So is it impossible to close client connection to broker (or at least delete queue to force disconnect) using publisher application? I tried achieve it by setting expiry-policy
with timeout
params, but it doesnt work.
So is it impossible to close client connection to broker (or at least delete queue to force disconnect) using publisher application?
You can close the publisher's connection at any time. The AMQP 1.0 specification does not define a way to delete the queue, but brokers often have their own ways of doing this through a message based management protocol. You can ask the RabbitMQ support if they have anything like that.
I tried achieve it by setting
expiry-policy
withtimeout
params, but it doesnt work.
That would generally only affect queues that were implicitly created when the publisher attaches I believe.
Yes, but closing publisher connection will not imply consumer disconnect from broker queue. Am I right? Connections are independent and Publisher has no power to manage consumer connection with broker?
Publisher has no power to manage consumer connection with broker?
Correct. The only way to do that would be through some broker specific management protocol.
Thanks a lot.
I am trying to implement provider and client data transfer with rabbitmq as a broker. Messages are transferring but I am not able to control if Receiver received it. I tried use
autoaccept
function tofalse
at the receiver side but Sender sidecontainer.on('accepted')
event is firing all the time - also when at the receiver side I am addingcontainer.on('message', (context) => { context.delivery.reject() });
It is changing nothing. Sender fireaccepted
event even if receiver is not connected! How can I manage? I need to know if messages are reading by clients.And another question: How to know at the sender side that receiver close connection if there are two applications: client and server - and they are creating own connections with broker?