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

Acknowledgments doesnt work #395

Open
sossnowski opened this issue Jan 25, 2023 · 6 comments
Open

Acknowledgments doesnt work #395

sossnowski opened this issue Jan 25, 2023 · 6 comments

Comments

@sossnowski
Copy link

sossnowski commented Jan 25, 2023

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 to false at the receiver side but Sender side container.on('accepted') event is firing all the time - also when at the receiver side I am adding
container.on('message', (context) => { context.delivery.reject() });
It is changing nothing. Sender fire accepted 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?

@grs
Copy link
Member

grs commented Jan 25, 2023

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.

@sossnowski
Copy link
Author

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.

@grs
Copy link
Member

grs commented Jan 26, 2023

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 with timeout params, but it doesnt work.

That would generally only affect queues that were implicitly created when the publisher attaches I believe.

@sossnowski
Copy link
Author

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?

@grs
Copy link
Member

grs commented Jan 26, 2023

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.

@sossnowski
Copy link
Author

Thanks a lot.

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