[
https://issues.apache.org/jira/browse/CAMEL-6784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13789863#comment-13789863
]
Christian Posta commented on CAMEL-6784:
----------------------------------------
Or try using the BrowsableEndpoint like this:
BrowseableEndpoint endpoint = camelContext.getEndpoint("amqp:queue:ping",
BrowseableEndpoint.class);
int messageCount = endpoint.getExchanges().size();
AMQP component uses the JMS component under the covers (which uses Spring
DMLC)... I don't think you can force the DMLC to do a browse as it's event
driven and a browse is a static snapshot. The BrowsableEndpoint does allow you
to take a browse of the queue into a static snapshot and process each exchange
as you'd wish.
If that helps, then we can close this JIRA.
> PollingConsumer.receiveNoWait() never returns null consuming from
> AMQPComponent endpoint in browsing mode
> ---------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-6784
> URL: https://issues.apache.org/jira/browse/CAMEL-6784
> Project: Camel
> Issue Type: Bug
> Components: camel-amqp
> Affects Versions: 2.10.2
> Reporter: Dmytro Puzhay
>
> I create PollingConsumer for my AMQP queue and consume with receiveNoWait()
> until null is received. It worked nicely in default mode, but in browsing
> mode (queue name suffixed with "{mode: browse}", see
> https://qpid.apache.org/books/0.12/Programming-In-Apache-Qpid/html/ch02s04.html
> "2.4.3.3. browse" for details) my PollingConsumer keeps running infinitely.
--
This message was sent by Atlassian JIRA
(v6.1#6144)