I'm creating a pretty basic application using RabbitMQ for messaging. Messages are published on one server, then a second server downstream will have a long-running process that consumes messages. Right now, I have it set up as follows:
Publisher:
- Declares direct exchange myexchange
- Publish message to myexchange exchange with routing key payload.routingkey
Consumer program:
- Declares direct exchange myexchange
- Declares queue my-specific-queue-name (with option durable set to
true
) - Bind my-specific-queue-name queue to myexchange exchange
- Consume messages from my-specific-queue-name
I've got this process working well. The situation I'm running into is that if my consumer program dies, it seems that new messages published to myexchange will be lost, as no queue will be bound to the exchange. Is there a configuration where even if the consumer program goes away, messages can still be queued so that when a consumer program comes back online, the messages will still be able to be received?