2 Replies Latest reply on Jan 26, 2015 5:48 AM by andrefrancisco

    Camel Binding - Aggregation Strategy

    andrefrancisco

      We are developing a project with Service Works and we are having some troubles using Aggregation Strategies.

       

      In Switchyard, using the component with the Camel binding, when we try to use the strategyRef within the Splitter EIP, we are getting a

      "Caused by: org.apache.camel.NoSuchBeanException: No bean could be found in the registry for: org.apache.camel.processor.aggregate.GroupedExchangeAggregationStrategy of type: org.apache.camel.processor.aggregate.AggregationStrategy"

       

      This happens both with the default Camel strategies and our Custom strategies. Could someone please help us figuring out how to add beans to the registry or how to use the Aggregation Strategies correctly?

        • 1. Re: Camel Binding - Aggregation Strategy
          slayercode2

          Hello,

           

          To add a bean to the registry, you have to annotate it with @Named("myBeanName") and you can use it in a camel route, as follows: <route><bean ref="myBeanName" method="myMethodName"/>.</route>

           

          A camel processor can developped as follows:

          @Named("MyProcessor")

          public class MyProcessor implements org.apache.camel.Processor {

              public MyProcessor() {

              }

              @Override

              public void process(org.apache.camel.Exchange exchange) throws Exception {

                   //your code

              }

          }

          You can integrate this processor in your route  as follows: <route><process ref="MyProcessor"/></route>

          • 2. Re: Camel Binding - Aggregation Strategy
            andrefrancisco

            Hi Akram!

             

            Thank you so much! It worked just fine