Event Mediator
The Event Mediator redirects incoming events to the specified event topic. For more information, see Working with Topics and Events.
The Event mediator is a content-aware mediator.
Syntax
<event xmlns="http://ws.apache.org/ns/synapse" topic="" [expression=""] />
UI Configuration
The parameters available for configuring the Event mediator are as follows:
Parameter Name | Description |
---|---|
Topic Type | The type of topic. The available options are as follows.
|
Topic | The topic to which the events should be published. You can enter a static value or an XPath expression based on the option you selected for the Topic Type parameter. Tip You can click NameSpaces to add namespaces when you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. |
Expression | The XPath expression used to build the message to be published to the specified topic. Tip You can click NameSpaces to add namespaces when you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. |
Note
You can configure the mediator using XML. Click switch to source view in the Mediator window.
Examples
In this example, when an event notification comes to the EventingProxy
proxy service, they are processed by the PublicEventSource
sequence, which logs the messages and publishes them to the topic SampleEventSource
. Services that subscribe to the topic SampleEventSource
will then receive these messages.
<!-- Simple Eventing configuration --> <definitions xmlns="http://ws.apache.org/ns/synapse"> <sequence name="PublicEventSource" > <log level="full"/> <event topic="SampleEventSource"/> </sequence> <proxy name="EventingProxy"> <target inSequence="PublicEventSource" /> </proxy> </definitions>
Sample
See the following sample for another example.