The Event Mediator redirects incoming events to the specified event topic. For more information, see Working with Topics and Events.
Syntax
<event xmlns="http://ws.apache.org/ns/synapse" topic="" [expression=""] />
UI Configuration
The configuration options for Event Mediator are:
- Topic Type
- Static
- Dynamic
- Topic - Topic to which the events are published. This can be a static topic, or can be specified using an XPath as a dynamic topic.
- Expression - XPath expression that builds the message to be published to the topic.
Note
You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.
Example
<!-- 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>
In this scenario, 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.
See also Sample 460: Introduction to Eventing and Event Mediator.