camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-7833) create an extension of the RX Observable<T> to add more of the Camel DSL in there (e.g. to() or to go back to the general camel DSL)
Date Thu, 02 Apr 2015 07:52:54 GMT

     [ https://issues.apache.org/jira/browse/CAMEL-7833?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Willem Jiang resolved CAMEL-7833.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.16.0

Applied the patch into camel master branch with thanks to Jyrki, I also did some change on
the CamelOperation to use ProducerTemplate and handler the exception which is thrown from
to processing.

> create an extension of the RX Observable<T> to add more of the Camel DSL in there
(e.g. to() or to go back to the general camel DSL)
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-7833
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7833
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: james strachan
>            Assignee: Willem Jiang
>             Fix For: 2.16.0
>
>
> with Camel RX and java 8 we can do some nice lambdas and typesafe filtering and transformation:
> {code}
> ReactiveCamel rx = new ReactiveCamel(camelContext);
> Observable<Order> observable = rx.toObservable("seda:orders", Order.class);
>  
> // now lets filter and map using Java 8
> Observable<String> largeOrderIds = observable.
>   filter(order -> order.getAmount() > 100.0).
>   map(order -> order.getId());
>  
> rx.sendTo(observable, "activemq:MyQueue");
> {code}
> however the DSL isn't quite as nice as Camel's due to the lack of the camel verbs like
"to()". It'd be nice to provide an extended Observable<T> interface which adds more
of Camel's DSL in there too; so you can still use things the RX way; but can also reuse the
camel DSL too (in a typesafe way). 
> e.g. something like this
> {code}
> // Observable comes from RX; it'd be nice to have a camel extended version so we can
add camel DSL stuff in there like to() etc....
> CamelStream<Order> orders = rx.stream("seda:orders", Order.class);
>  
> // now lets filter and map using Java 8
> orders.
>   filter(order -> order.getAmount() > 100.0).
>   map(order -> order.getId()).
>   to("activemq:MyQueue");
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message