Hi,
I'm writing a client that publishes messages to a topicExchange, and another clients that bind the exchange to their own queue and receive relevant messages fine. (these will be one client soon but for simplicity I'm keeping them separate for the moment)
The problem I have is when the receiving client is not listening - i.e. it hasn't got a SimpleMessageListenerContainer started, or it's not running. I'd expect the queue to fill, as the queue and binding still exist (the queue is durable)
The queue and binding is as follows:
public TopicExchange exch() {
TopicExchange ex = new TopicExchange(exchangeName);
ex.setDurable(true);
return ex;
}
public Queue rcvQueue() {
Queue recQueue = new Queue(this.recQueueName);
recQueue.setAutoDelete(false);
recQueue.setDurable(true);
return recQueue;
}
Binding is done in code:
Binding bind = BindingBuilder.from(receiveQueue).to(exchange).wit h("a.#");
admin.declareBinding(bind);
If I send a bunch of messages, running the following shows my queue but no messages:
rabbitmqctl list_queues name messages_ready messages_unacknowledged messages consumers
Listing queues ...
myTAsyncQueue 0 0 0 0
My bindings:
Listing bindings ...
exchange myTAsyncQueue queue myTAsyncQueue []
myTExchange exchange myTAsyncQueue queue a.# []
...done.
I've got setRequireAck, setMandatoryPublish and setImmediatePublish all to true on the RabbitTemplate and I'm sending using RabbitTemplate:
template.convertAndSend(routingKey, message);
As soon as I start my client again, it picks up further messages but all the ones in between are gone.
I would really appreciate a point in the right direction.
Thanks


Reply With Quote
