So it seems for my use case I can just continue to call receive until it 
returns null.  Although this meets my requirement I have the tricky issue that 
the timeout is being used for each call.  Therefore the total time of the 
process could be infinite, even if a timeout is specified.  It's easy for me to 
keep my own overall timeout to prevent this.

  Does it make sense to put in a JIRA request for adding a Queue<Exchange> 
recieveMultiple() method?  This seems easy to implement and could ensure that 
the timeout parameter is honored.

  Anyone else think this is a good idea, or am I the only one using the 
consumer like this outside of a route?

~Justin

From: Justin Rosenberg
Sent: Wednesday, June 03, 2015 4:02 PM
To: [email protected]
Subject: RE: Batch Consuming with ConsumerTemplate

If can't be done with the ConsumerTemplate, an example using the BatchConsumer 
API to get the list of exchanges would be very helpful.

My specific use case would be using the sftp endpoint to download N files at 
once using the API (not defining a route).  The idea would be to use a filter 
where I know there will be more than one file found by the filter.

What I would expect to be able to do is something like:

Exchange[] exchanges = consumer.recieve();

But obviously the approach is much different.  It's not obvious to me through 
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/BatchConsumer.html
 or any other Consumer API how this could be accomplished.

Thank you,

~Justin

From: Justin Rosenberg
Sent: Wednesday, June 03, 2015 10:55 AM
To: [email protected]<mailto:[email protected]>
Subject: Batch Consuming with ConsumerTemplate

  If you use consumerTemplate.receive() with a BatchConsumer enabled endpoint, 
how do you interact with the Exchange to get the multiple bodies (files for 
example)?

~Justin


CONFIDENTIALITY NOTICE:
The information in this message, and any attachment, is intended for the 
sole use of the individual and entity to whom it is addressed. This 
information may be privileged, confidential, and protected from 
disclosure. If you are not the intended recipient you are hereby notified 
that you have received this communication in error and that any review, 
disclosure, dissemination, distribution or copying of it, or its contents, 
is strictly prohibited. If you think that you have received this message 
in error please notify the sender and destroy all copies of this 
communication and any attachments. Thank you.

Reply via email to