This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Event Mediator

The Event Mediator publishes events to the given event source. Thus, the presence of defined event sources is 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

<syn:eventPublisher eventSourceName="event-source-name"/>

UI Configuration

The only configuration option for Event Mediator is:

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 Manage-> Service Bus-> Event Sources menu of the right hand side menu bar. See Eventing.

Note

You can configure the Mediator using XML. Click on "switch to source view" in the "Mediator" window.


Usage Scenario

<!-- Simple Eventing configuration -->
 <definitions xmlns="http://ws.apache.org/ns/synapse">
      <eventSource name="SampleEventSource">
            <subscriptionManager class="org.apache.synapse.eventing.managers.DefaultInMemorySubscriptionManager">
                <property name="topicHeaderName" value="Topic"/>
                <property name="topicHeaderNS" value="http://apache.org/aip"/>
            </subscriptionManager>
      </eventSource>

     <sequence name="PublicEventSource" >
            <log level="full"/>
            <eventPublisher eventSourceName="SampleEventSource"/>
     </sequence>

     <proxy name="EventingProxy">
         <target inSequence="PublicEventSource" />
     </proxy>
 </definitions>

In this scenario, user has defined an event source called SampleEventSource. When an event notification comes to the EventingProxy Proxy Service, the messages will be logged and then sent to the event source.