Skip to main content
formatting
Source Link
Glorfindel
  • 3.2k
  • 6
  • 28
  • 34

If my understanding so far is correct my main question comes from how to handle these consumers on the services end. If I am using acknowledgement my understanding is that even if one of my consumers dies the queue and message will not be deleted. Both will persist and wait for the a new consumer indefinitely.

Yes, you should use an exchange publishing to one queue per use case, as described here: https://www.rabbitmq.com/tutorials/tutorial-three-php.htmlhere.

For making sure that a consumer actually receives and can handle a message, read up on consumer acknowledgements here: https://www.rabbitmq.com/confirms.htmlhere.

If you need the queue to keep not consumed messages even if rabbitmq dies, use persistent queues persistent queues (scroll down to Message durability): https://www.rabbitmq.com/tutorials/tutorial-two-php.html

Any number of services will presumably want to consume lots of different messages. Is it okay to have lots of different consumers constantly running?

Yes that's pretty much what it's designed for. If rabbitMQ gets slow at some point, you can also scale rabbitMQ, but I cannot talk about any experience for the reliability here, as I have never had to use the scaling.

One other question that you should keep in mind when working with a message broker is how you want to introduce a new service which needs to consume the same messages (in this case users). Due to the exchange only routing messages and not persisting them - the messages sent before will be lost, so you will need a different way to populate new services.

If my understanding so far is correct my main question comes from how to handle these consumers on the services end. If I am using acknowledgement my understanding is that even if one of my consumers dies the queue and message will not be deleted. Both will persist and wait for the a new consumer indefinitely.

Yes, you should use an exchange publishing to one queue per use case, as described here: https://www.rabbitmq.com/tutorials/tutorial-three-php.html

For making sure that a consumer actually receives and can handle a message, read up on consumer acknowledgements here: https://www.rabbitmq.com/confirms.html

If you need the queue to keep not consumed messages even if rabbitmq dies, use persistent queues (scroll down to Message durability): https://www.rabbitmq.com/tutorials/tutorial-two-php.html

Any number of services will presumably want to consume lots of different messages. Is it okay to have lots of different consumers constantly running?

Yes that's pretty much what it's designed for. If rabbitMQ gets slow at some point, you can also scale rabbitMQ, but I cannot talk about any experience for the reliability here, as I have never had to use the scaling.

One other question that you should keep in mind when working with a message broker is how you want to introduce a new service which needs to consume the same messages (in this case users). Due to the exchange only routing messages and not persisting them - the messages sent before will be lost, so you will need a different way to populate new services.

If my understanding so far is correct my main question comes from how to handle these consumers on the services end. If I am using acknowledgement my understanding is that even if one of my consumers dies the queue and message will not be deleted. Both will persist and wait for the a new consumer indefinitely.

Yes, you should use an exchange publishing to one queue per use case, as described here.

For making sure that a consumer actually receives and can handle a message, read up on consumer acknowledgements here.

If you need the queue to keep not consumed messages even if rabbitmq dies, use persistent queues (scroll down to Message durability):

Any number of services will presumably want to consume lots of different messages. Is it okay to have lots of different consumers constantly running?

Yes that's pretty much what it's designed for. If rabbitMQ gets slow at some point, you can also scale rabbitMQ, but I cannot talk about any experience for the reliability here, as I have never had to use the scaling.

One other question that you should keep in mind when working with a message broker is how you want to introduce a new service which needs to consume the same messages (in this case users). Due to the exchange only routing messages and not persisting them - the messages sent before will be lost, so you will need a different way to populate new services.

Source Link
minime
  • 181
  • 5

If my understanding so far is correct my main question comes from how to handle these consumers on the services end. If I am using acknowledgement my understanding is that even if one of my consumers dies the queue and message will not be deleted. Both will persist and wait for the a new consumer indefinitely.

Yes, you should use an exchange publishing to one queue per use case, as described here: https://www.rabbitmq.com/tutorials/tutorial-three-php.html

For making sure that a consumer actually receives and can handle a message, read up on consumer acknowledgements here: https://www.rabbitmq.com/confirms.html

If you need the queue to keep not consumed messages even if rabbitmq dies, use persistent queues (scroll down to Message durability): https://www.rabbitmq.com/tutorials/tutorial-two-php.html

Any number of services will presumably want to consume lots of different messages. Is it okay to have lots of different consumers constantly running?

Yes that's pretty much what it's designed for. If rabbitMQ gets slow at some point, you can also scale rabbitMQ, but I cannot talk about any experience for the reliability here, as I have never had to use the scaling.

One other question that you should keep in mind when working with a message broker is how you want to introduce a new service which needs to consume the same messages (in this case users). Due to the exchange only routing messages and not persisting them - the messages sent before will be lost, so you will need a different way to populate new services.