Hi All,
   I am working on a custom mediator that must allow me to deal with
messages' routing. I must change the destination Endpoint depending on
what the single message is containing, and proceed forward with the
other Mediators in the sequence.

In a first moment I thought it was possible to solve the issue using the
Switch Mediator, but several problems came around. The Switch Mediator
is based on regular expressions, and maybe they are not that handy for
average administrators; while keeping the default case for tracing
errors, I could have some problems if I need to "narrow" somehow a not
existing case to an existing one (if for example I get calls for the
version 1.3 of a service and I have just the 1.1 and the 1.5 available,
I could think to "narrow" the call either to the one or to the other).

That's why I tried to write a custom mediator which relies on a routing
table based on an HashMap: in my idea I wanted to couple a key to an
Endpoint and use it to route properly the message, so if for some
reasons I need to modify the default routing, I can retrieve an endpoint
from this map. What I am actually trying to do is to set in my mediator
and Endpoint that should have to be used by the last Mediator in the
sequence (the Send mediator) and allows the message to pass through
other mediators in the sequence (i.e. the Log Mediator).

It's very likely a scenario in which the routing decision could pass
through several mediators on the sequence working more or less the same
way (I could maybe need to evaluate the version of the service in a
first mediation, the type or the service - service with or without
subscription- and so on). That's why I thought that the best way to
solve the problems could be to put the Endpoint to root at in the
MessageContext, since that's available to all mediators. 

Is there a way to make the destination Endpoint available to the other
mediators using the MessageContext ? Am I heading the right way or
should I need to focus on something I didn't consider yet, in order to
solve this issue?

Thanks a lot
L.
_______________________________________________
Esb-java-user mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to