Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
        from("activemq:topic:OrdersTopic").
                filter().expression(BeanLanguage(MyBean.class, "isGoldCustomer")).
                to("activemq:BigSpendersQueue");

There is a nicer way of doing the above as we can leverage the fact the bean is included in the RouteBuilder. However this only works when referring to either a reference or a class name of the bean. The example below you have to use the BeanLanguage.bean. This is due to java cannot distinguish between a String and Object parameter when you either want to use a reference or a instance.

Code Block
java
java

        from("activemq:topic:OrdersTopic").
                filter().bean(MyBean.class, "isGoldCustomer")).
                to("activemq:BigSpendersQueue");

...

Code Block
java
java
   private MyBean my;

        from("activemq:topic:OrdersTopic").
                filter().expression(BeanLanguage.bean(my, "isGoldCustomer")).
                to("activemq:BigSpendersQueue");

...