Versions Compared

Key

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

...

Wiki Markup
{snippet:id=e1|lang=java|url=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/config/AnotherCamelProxyTest.java}

In Camel 2.3 you can define that proxied methods which has void as return type, can be treated as Fire and Forget messaging style (aka InOnly). This is done by setting the attribute voidAsInOnly=true in the <proxy/> tag. If you let it be the default value, which is InOut then a void method will still wait for the message to be completely routed. This is not always what you want and hence you can use this option to turn it onto a fire and forget style. BTW: You can also add the @InOnly annotation to the method on the interface to tell Camel that this method is InOnly.

Such an example is shown below:

Wiki Markup
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/config/CamelProxyVoidAsInOnlyTest.xml}

Proxy from Java

You can also create a proxy from regular Java using a org.apache.camel.component.bean.ProxyHelper as shown below:

...