Hi Eric,

Yes this is possible, please see my comments in-line.

Hubert, Eric wrote:
Hi all,
I have a question regarding content based routing. If I have some fields in either the SOAP header or the HTTP header of a message and would like to combine them (append one after the other) and use the result as an expression to match agains several regular expressions in each case of a switch mediator, could that work? How and where can I do the concatenation?
You should use the fn:concat(string, string) xpath function inside the expression of the switch mediator to get the concatenation of the result expression.
Here I have a quite simple example. Suppose I have the following header information (can be more parameters) <clientId>wap_app39</clientId>
<version>1.1</version>
<country>de</version>
And I would like to combine them in a well defined order like: wap_app39#1.1#de and then define routing like that: *#1.1#de --> endpoint1 wap_app3?#1.1#* --> endpoint2
<switch source="concat(concat(concat(concat(clientId, '#'), version), '#'), country)">
<case regex="*#1.1#de">.....</case>
</switch>
Would that be possible? Any better approach? After the first match, the evaluation shall be stopped. If no match route to some special failure sequence.
It must be possible to execute other mediators (like some mediator to 
asynchronously log into the db), bevor the message will be send out.
All this is possible Eric, general behavior of the switch mediator is that if it matches one case it will not execute other cases. Also there is a <default> element for the switch mediator, which can be used for the fault sequence that you wanted to use.

Thanks,
Ruwan
Thanks,
   Eric
------------------------------------------------------------------------

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


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

Reply via email to