Event Mediator

Event mediator publishes events to the given event source. Thus, the presence of defined event sources are necessary prior to the usage of this mediator. User can apply any mediation before sending the message to the event source. This allows features like transformation, logging, filtering to be applied to a message coming to an Event Source.

Syntax

<event xmlns="http://ws.apache.org/ns/synapse" topic="" [expression=""] />

UI Configuration

  • Event Source: Select a source from currently available event sources. You can define event sources from the "Event Sources" panel which can be accessed from Configure-> Event Sources menu of the right hand side menu bar.

Usage Scenario

<!-- 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 user has defined an event topic called SampleEventSource. When a event notification comes to the EventingProxy proxy service, the messages will be logged and then sent to the event topic.