camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to implement AsyncCallback for AsyncProcessor?
Date Mon, 02 May 2016 11:48:54 GMT
AsyncCallback is an implementation detail for component developers,
and the EIPs that are shipped in Camel.

What is your use-case?


On Mon, May 2, 2016 at 1:40 PM, Sven Bauhan <sven.bauhan@ast.dfs.de> wrote:
> On 04/29/16 21:29, Claus Ibsen wrote:
>>
>> On Wed, Apr 27, 2016 at 10:05 PM, Sven Bauhan <sven.bauhan@ast.dfs.de>
>> wrote:
>>>
>>> Hi,
>>>
>>> I found the explanation for an AsyncProcessor:
>>> http://camel.apache.org/asynchronous-processing.html
>>>
>>> But I do not understand how to implement the corresponding AsyncCallback.
>>> I did not find any example, how this can be done.
>>>
>>> As the done() method just gets the boolean flag, I do not know how the
>>> exchange can be provided in this class.
>>>
>>> Can you give me a hint or an example?
>>>
>> If you have the Camel in Action book its covered in the concurrency
>> chapter.
>>
>> There is a little example here
>>
>> https://github.com/camelinaction/camelinaction2/tree/master/chapter13/scalability
>
> In this example, the interface AsyncCallback is not implemented at all. And
> it does not show how an AsyncCallback is used in a route definition.
>>
>> You can create an async callback class and provide the exchange as a
>> constructor, or make the exchange final so you can refer to it from an
>> anonoymous callback.
>>
>>
> I do not understand how this could be done.
> An exchange is not available at construction of class or in the route
> definition.
> The route builder does not know anything about exchanges, so how could it
> provide one as a constructor parameter?
>
> Thanks, Sven
>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message