...
Its often required to support the InOnly message exchange pattern for asynchronous or one way operations. These are often called 'fire and forget' like sending a JMS message but not waiting for any response.
From 1.5 onwards Camel supports annotations for specifying the message exchange pattern on regular Java methods, classes or interfaces.
Typically the default InOut is what most folks want but you can customize to use InOnly using an annotation.
Code Block |
---|
public interface Foo {
Object someInOutMethod(String input);
String anotherInOutMethod(Cheese input);
@InOnly
void someInOnlyMethod(Document input);
}
|
The above code shows three methods on an interface; the first two use the default InOut mechanism but the someInOnlyMethod uses the InOnly annotation to specify it as being a oneway method call.