needed to reconfigure our mule-config and i was really confused about the whole mule documentation… i really think its crap, but i figured it out 🙂
first a side note to the documentation: we use flows… and a co-worker told me, that flows are kinda new, so not everything might work… its kinda documented, but without any example… so hard to figure it out…
so what did i need? just a simple flow, which sends the result to the next flow… so simple outbound to inbound…
mule-config.xml
<flow name="fooWorklow">
<vm:inbound-endpoint ... />
<component class="Foo" />
<vm:outbound-endpoint path="myFooBar" exchange-pattern="one-way">
<payload-type-filter expectedType="FoobarMessage" />
</vm:outbound-endpoint>
</flow>
<flow name="barWorkflow">
<vm:inbound-endpoint path="myFooBar" exchange-pattern="one-way" />
<component class="Bar" />
</flow>
and some more… so the connection between these two workwlows is made by the path=”myFooBar”… in config… additionally the outbound payload-type-filter is a rooter, which defines, that only the class foobarMessage is allowed on this connection and only this class will be sent… other result will be burned (at the koax terminator)… so how do the classes look like?
Foo
public class Foo{
public FoobarMessage inboundMethod(){
...
return foobarMessage;
}
}
Bar
public class Bar{
public void process(FoobarMessage msg){
...
}
}
and how does the message finds it method? Reflection… so just create one method with the message argument and voila… it finds it 🙂 pretty cool…