...
Code Block |
---|
Endpoint endpoint = context.getEndpoint("activemq:my.queue"); PollingConsumer consumer = endpoint.createPollingConsumer(); Exchange exchange = consumer.receive(); |
There are 3 main polling methods on PollingConsumer
Method name | Description |
---|---|
Waits until a message is available and then returns it; potentially blocking forever | |
receive(long)http://activemq.apache.org/camel/maven/camel-core/apidocs/org/apache/camel/PollingConsumer.html#receive(long)] | Attempts to receive a message exchange immediately without waiting and returning null if a message exchange is not available yet |
Attempts to receive a message exchange, waiting up to the given timeout and returning null if no message exchange could be received within the time available |
Scheduled Poll Components
...