This documentation is for WSO2 Enterprise Service Bus version 4.8.1 . View documentation for the latest release.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

The Event Mediator redirects incoming events to the specified event topic. For more information, see Working with Topics and Events.


Table of Contents
maxLevel3
minLevel3
styleborder:1
locationtop
typeflat
separatorpipe


Syntax

Code Block
XML
XML
<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.
Info
titleNote

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


Example

Code Block
XML
XML
<!-- 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.