blob: 406f53596066b970e5ac93605b5e4fe8c59359ab [file] [log] [blame]
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
<synapse xmlns="">
<!-- illustration of simple properties, and reusable endpoints and sequences -->
<!-- define a string literal property -->
<set-property name="version" value="0.1"/>
<!-- define a reuseable endpoint definition -->
<endpoint name="simple"
<!-- define a reusable sequence -->
<sequence name="stockquote">
<!-- log the message using the custom log level. illustrates custom properties for log messages -->
<log level="custom">
<property name="Text" value="Sending quote request"/>
<property name="version" expression="get-property('version')"/>
<property name="symbol" expression="get-property('symbol')"/>
<!-- send message to real endpoint referenced by name "stockquote" endpoint definition -->
<endpoint ref="simple"/>
<!-- match the 'To' EPR to the given regex -->
<filter source="get-property('To')" regex=".*/SimpleStockQuoteService.*">
<!-- set a custom local message property based on the stock code requested -->
<switch source="//m0:getQuote/m0:request/m0:symbol"
<case regex="IBM">
<set-property name="symbol" value="Great stock - IBM"/>
<case regex="MSFT">
<set-property name="symbol" value="Are you sure? - MSFT"/>
<!-- it is possible to assign the result of an XPath expression as the value of a local message property -->
<set-property name="symbol"
expression="fn:concat('Normal Stock - ', //m0:getQuote/m0:request/m0:symbol)"
<!-- invoke an already defined [reusable] sequence at this point -->
<sequence ref="stockquote"/>
<!-- Log all messages passing through -->
<log level="full"/>
<!-- Send the messages where they have been sent (i.e. implicit To EPR) -->