[ 
https://issues.apache.org/jira/browse/CAMEL-4434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200765#comment-13200765
 ] 

Nadav Wiener commented on CAMEL-4434:
-------------------------------------

I was just about to open a similar bug when I found this one -- too bad you 
decided to close it.

Currently, if you want to send a message to a route, there is no simple 
standard API to do so in Camel.
What's more problematic, is that ProducerTemplate provides an asynchronous API 
that's *not based on the asynchronous routing engine*, and in fact relies on a 
dedicated thread pool.

Currently, if I want to send a "threadless" asynchronous message to a SEDA 
endpoint, I found that I have to obtain the Endpoint, create a Producer 
manually and manage its lifecycle on my own -- the kind of usage that is 
generally frowned upon these days.

Being able to do so through a ProducerTemplate will promote non-blocking 
concurrency in Camel as something that's easily available to the developer, and 
respect the "rule of least surprise".

If maintaining API stability is an important factor, perhaps some mechanism can 
be provided to reconcile the difference between AsyncCallback and 
Synchrnization. However, I don't see how this can be done well, and just adding 
an AsyncCallback variation everywhere Synchronization is currently used will 
probably be a lot easier and more comprehensible.

Alternatively, if there is some other obvious way to use the asynchronous 
routing engine from client code that I am missing, it would be nice to draw 
some attention to it in the documentation.
                
> ProducerTemplate - Should have async API which offers the Camel specific 
> AsyncCallback API
> ------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4434
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4434
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.9.0
>
>
> This allows you to use the producer template and have the callback invoked 
> using the async routing engine. 
> The current API is using the JDK threads pool and Future abstraction. We 
> should offer the Camel specific AsyncCallback API as well.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to