Hey guys,

I'm just starting to get started with synapse, and I was going through the
samples.  I have a question about a possible issue regarding the switch
case mediator.  If one of the cases exists, is the default still supposed
to be executed?

For instance, on the tutorial
http://synapse.apache.org/userguide/samples/sample2.html if I enter in the
options listed, I get the following:

IBM-

2016-01-30 09:46:09,972 [-] [HttpServerWorker-4]  INFO LogMediator symbol =
Great stock - IBM, epr =
http://localhost:9000/services/SimpleStockQuoteService
2016-01-30 09:46:09,988 [-] [HttpClientWorker-4]  INFO LogMediator symbol =
Normal Stock - , epr = http://www.w3.org/2005/08/addressing/anonymous

MSFT-

2016-01-30 09:43:26,970 [-] [HttpServerWorker-2]  INFO LogMediator symbol =
Are you sure? - MSFT, epr =
http://localhost:9000/services/SimpleStockQuoteService
2016-01-30 09:43:26,970 [-] [HttpClientWorker-2]  INFO LogMediator symbol =
Normal Stock - , epr = http://www.w3.org/2005/08/addressing/anonymous

SUN-

2016-01-30 09:44:36,095 [-] [HttpServerWorker-3]  INFO LogMediator symbol =
Normal Stock - SUN, epr =
http://localhost:9000/services/SimpleStockQuoteService
2016-01-30 09:44:36,111 [-] [HttpClientWorker-3]  INFO LogMediator symbol =
Normal Stock - , epr = http://www.w3.org/2005/08/addressing/anonymous

This does not seem right to me; I don't understand why the second line in
each case is being outputted.  Also, the configuration language states:

"The <switch> mediator will evaluate the given source xpath expression into
its string value, and match it against the given regular expressions. If
the specified cases does not match and a default case exists, it will be
executed."

It's a bit unclear, but to me, this reads as the default will be executed
only if specified cases do not match.

I'd love to create a Jira issue and start working on a patch, however,
before I do so, I'd like some feedback about whether this is indeed
functioning incorrectly, or whether I am misinterpreting things.

Thanks,

Arjun

Reply via email to