On Wed, Jan 14, 2009 at 9:24 AM, mta38 <mtaraud....@orange-ftgroup.com> wrote:
>
> Thanks Ibsen and Willem for your answer,
> I already try PollingConsumer class, but it does not correspond to my
> problem.
> Really, I want that a client send a request (with a correlation ID 10 for
> example) and block until it receives a response with the same correlation
> ID, such as a selector in JMS.
> In other words, Is Jms component is the only which permit to use selector?
Yeah as it is a part of the JMS spec.

Otherwise you can use a filter to implement the selector and send OK
data to a seda queue
and have a consumer on the seda queue

from(x).filter(header("xxx").isEqualTo("foo")).to("seda:yeah")

from"seda:yeah")...

The filter can use all kind of Expression and Predicate so you can
invoke a bean (POJO) and let it determine true|false if the exchange
should be filtered or not.

http://activemq.apache.org/camel/message-filter.html

If you dont wanna LOSE unfiltered messages, you can use a choice and
route the false messages into another destination


James you got any good ideas?





>
> Best Regards,
>
> Mta38
>
>
>
>
>
> Claus Ibsen-2 wrote:
>>
>> Hi
>>
>> Yeah using the org.apache.camel.PollingConsumer - it can block until a
>> message arrives, or until a given timeout.
>>
>> It requires however that you use the Camel API a bit to use it instead
>> of the route or producer template.
>>
>> We have a sample of this with the FTP component where it will wait
>> until there is a file to download
>> http://activemq.apache.org/camel/ftp.html
>>
>>
>>
>> On Thu, Jan 8, 2009 at 6:33 PM, mta38 <mtaraud....@orange-ftgroup.com>
>> wrote:
>>>
>>> Hi all,
>>> Is there a way to do a request/reply request in a thread?
>>> In fact in my thread I create a request and I want to send this request
>>> to a
>>> camel route (via a camel context) and I want to be "blocked" until I
>>> receive
>>> the response.
>>> Is someone having an idea?
>>> Best regards
>>> Mta38
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Thread-%2C-Request-Response-tp21356633s22882p21356633.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>>
>> /Claus Ibsen
>> Apache Camel Committer
>> Blog: http://davsclaus.blogspot.com/
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Thread-%2C-Request-Response-tp21356633s22882p21451725.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 

/Claus Ibsen
Apache Camel Committer
Blog: http://davsclaus.blogspot.com/

Reply via email to