[rabbitmq-discuss] what would cause queue size to immediately go to 0?
Shane
shane at digitalsanctum.com
Fri Nov 5 15:43:32 GMT 2010
Rob,
I'm using the SimpleMessageListenerContainer with a very simple
message handler and not using transactions. Here's the relevant config
(concurrentCustomers is 2):
@Bean
public SimpleMessageListenerContainer listenerContainer() {
SimpleMessageListenerContainer container = new
SimpleMessageListenerContainer();
container.setConnectionFactory(connectionFactory());
container.setMessageListener(messageListenerAdapter());
container.setConcurrentConsumers(concurrentConsumers);
container.setQueues(dexcQueue());
return container;
}
@Bean
public MessageListenerAdapter messageListenerAdapter() {
return new MessageListenerAdapter(cmdHandler(),
jsonMessageConverter());
}
@Bean
public CmdHandler cmdHandler() {
return new CmdHandler();
}
@Bean
public Queue dexcQueue() {
return new Queue(DexcQueue.DEXC_REQUEST.getQueueName());
}
@Bean
public FanoutExchange dexcExchange() {
return new
FanoutExchange(DexcExchange.DEXC_FANOUT.getExchangeName());
}
@Bean
public Binding dexcBinding() {
return BindingBuilder.from(dexcQueue()).to(dexcExchange());
}
On Nov 5, 11:22 am, Rob Harrop <r... at rabbitmq.com> wrote:
> On 5 Nov 2010, at 14:52, Shane wrote:
>
> > Thanks for the replies. It looks as though the messages are indeed all
> > acknowledged but I'm still puzzled as to why since I haven't changed
> > no_ack or QOS from their defaults.
>
> > I'm using Spring AMQP and Java client 2.1.1. Where should I be setting
> > or checking the settings mentioned?
>
> Well, in Spring AMQP noAck is managed for you depending on how you consume the messages.
>
> Are you using one of the MessageListenerContainer implementations? Also, are you using transactions?
>
>
>
>
>
>
>
>
>
>
>
> > On Nov 5, 9:56 am, Matthew Sackman <matt... at rabbitmq.com> wrote:
> >> On Fri, Nov 05, 2010 at 01:33:38PM +0000, Marek Majkowski wrote:
> >>> Please try using explicit acknowledgments, with no_ack=False
> >>> and do acks manually using `basic_ack`
>
> >> You might also need to use basic.qos to prevent the broker flooding the
> >> client with msgs. But in general, this behaviour is "fine", provided
> >> that's what you require in terms of behaviour of the consumers.
>
> >> It's always worth looking at messages_ready (i.e. messages in the queue
> >> which have not been delivered yet) and messages_unacknowledged (i.e.
> >> messages which have been delivered by the queue for which no
> >> acknowledgement has been received yet), to see quite what's going on.
> >> (The "messages" field is the sum of those two).
>
> >> Matthew
> >> _______________________________________________
> >> rabbitmq-discuss mailing list
> >> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-disc... at lists.rabbitmq.com
> >https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-disc... at lists.rabbitmq.comhttps://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list