[ 
https://issues.apache.org/jira/browse/CAMEL-8308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14987310#comment-14987310
 ] 

Ramon Rosa da Silva commented on CAMEL-8308:
--------------------------------------------

It isn't a camel issue, just a RabbitMQ configuration. By default RabbitMQ 
prefetch is unlimit, so it will get all messages available in broker.


> RabbitMQEndpoint: setting prefetchEnabled=false or prefetchCount=0 (default 
> values) locks all messages on RabbitMQ
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-8308
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8308
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-rabbitmq
>    Affects Versions: 2.14.1
>            Reporter: Daniel Neugebauer
>
> If RabbitMQEndpoint is configured with either prefetchEnabled=false or 
> prefetchCount=0 (both are default values), then messages appear to be locked 
> on server-side (getting prefetched with high/no limit?).
> To reproduce:
> # add multiple messages to a RabbitMQ queue which define an expiration header 
> (after expiration, RabbitMQ will remove those message from queue without 
> delivering them to consumers)
> # watch RabbitMQ admin panel, you should see n messages are "Ready", 0 
> messages are "Unacknowledged"
> # configure & run one concurrent RabbitMQEndpoint from Camel with above 
> settings + autoAck=false and delay/block processing of messages (e.g. by 
> running Thread.wait(10000) in a Processor)
> # watch the admin panel again: 0 messages are "Ready", n messages are 
> "Unacknowledged" - so Camel appears to have prefetched all messages?
> # wait until messages should have expired
> # admin panel still shows all unprocessed messages as unacknowledged although 
> they should have been removed from queue
> # Camel still processes those messages after expiration
> # stop Camel (returns all unacknowledged messages to ready state)
> # admin panel shows that all messages now have been purged from queue (much 
> later than they should have)
> Workaround: Repeating with prefetchEnabled=true and prefetchCount=1 shows 
> only 1 message "unacknowledged" while queue is being processed by Camel, all 
> other messages remain "ready" and expire in time (thus skipping the Camel 
> queue as expected).
> Expected behaviour: If the prefetcher is disabled, no messages should get 
> locked on server-side, so messages can be expired by RabbitMQ as intended by 
> the message sender.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to