Uploaded image for project: 'Camel'
  1. Camel
  2. 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)

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.16.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      with Camel RX and java 8 we can do some nice lambdas and typesafe filtering and transformation:

      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");
      

      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

      // 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");
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                njiang Willem Jiang
                Reporter:
                jstrachan james strachan
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: