This should work out of the box with SwitchYard. Make the Bean a @Named bean and use filter to select the method. I haven't tried it, but should work as it is Camel feature.
from("switchyard://StartService") .filter().method(MyBean.class, "isWhatIWant").to("switchyard://BostonService").end();
It is just a matter of you trying.
Hi Jorge. There is no Bean in here. My Component has the Java interface and Java Camel DSL as the component's implementation. The Java interface has methods and I want to divide the invocation of each method to separating processing, for example:
// if invoked method was save
// if invoked method was delete
Then you have some options:
- To do ContentBasedRouting based on the method being invoked. (It is set as "org.switchyard.operationName").
- Have different implementations for you component, each for every method.
First option is the easiest one, so you could do something like:
Thank you very much, Jorge. But where can I find the properties such as "
org.switchyard.operationName". Is the anywhere I can find them?
It is difficult to say. These properties are set internally by the engine. You can see them if you enable message tracing for the execution of a composite or debugging. I do not think there is documentation around these variables. I would encourage you to open a JIRA for a document with that info.
Keep in mind I'm a user not a SwitchYard developer ;-)