Hi,

I’m new to Camel, trying to get my head wrapped around conventions and usages 
and get some samples going. I’m trying to understand what is the difference 
between Consumer Templates and the @Handler Annotation.

According to http://camel.apache.org/manual/camel-manual-2.3.0.html 
<http://camel.apache.org/manual/camel-manual-2.3.0.html>

        @Handler

        Available as of Camel 2.0

        You can mark a method in your bean with the @Handler annotation to 
indicate that this method should be used for Bean Binding.
        This has the advantage as you do not have to specify the method name in 
the Camel route. And thus you do not run into problems when you rename the 
method name using an IDE that don't find all references.

        public class Bar {

                @Handler
                public String doSomething(Stringbody) { 
                        // process the in body and return whatever you want
                        return "Bye World";
        }

Given a bean with configured routes and a producer template, I get the 
impression that you could use a bean with a method annotated with @Handler in 
lieu of a bean with a regular method that uses a consumer template.

Is this correct? What am I missing? 

Also, I’m planning on using Spring Boot with Spring for Apache ActiveMQ and 
Apache Camel, do the producer/consumer, handler concepts change?

Thanks!

Reply via email to