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

Event Message

This section explains, through an example scenario, how the Event Message EIP can be implemented using the WSO2 ESB. The following topics are covered:

Introduction to Event Message

The Event Message EIP is used for reliable, asynchronous event notification between applications. For more information, see

Figure 1: Event Message EIP

Example scenario

When a subject has an event to be announced, it will create an event object, wrap it in a message, and send it to a set of subscribers. This example scenario uses several Axis2 server instances as subscribers. When a message arrives in the ESB, it will be transmitted through the event mediator to each of these server instances that act as a subscriber. 

The following diagram depicts how this example can be simulated using the ESB.

Figure 2: Example scenario of the Event Message EIP

Before digging into implementation details, let's take a look at the relationship between the example scenario and the Event Message EIP, by comparing their core components.

Event Message EIP (Figure 1)Event Message Example Scenario (Figure 2)
SubjectStock Quote Client
Event MessageEvent, Topic
ObserverStock Quote Service

The ESB configuration

Given below is the ESB configuration for simulating the example scenario explained above. 

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="">
   <proxy name="EventMessageProxy" transports="https http" startOnLoad="true" trace="disable">
            <event topic="stockquote" />
            <send />

Simulating the example scenario

Now, let's try out the example scenario explained above.

Setting up the environment 

You need to set up the ESB, and the back-end service:

  1. Download the file, which includes the ESB configuration described above. 
  2. See Setting up the Environment for instructions on setting up the ESB and the back-end service.

    When you set up the environment, note that you need to start two instances of the back-end service (Stock Quote Service) to simulate this example.

  3. Follow the steps below to create an event for the subscriber with port 9000.
    • Start the ESB and log into its Management Console. For instructions, see Starting the ESB in WSO2 ESB documentation.
    • Click Topics from the Main menu, and then click Add.
    • Enter stockquote as the topic name and then click Add Topic.
    • In the Topic browser, click the newly created stockquote topic and then click Subscribe to create a static subscription. 
    • Enter http://localhost:9000/services/SimpleStockQuoteService in the Event Sink URL field and click Subscribe.
  4. Repeat the above steps to add another subscriber in port 9001.

Executing the sample

Send the following message from a SOAP client like SoapUI:

<soapenv:Envelope xmlns:soapenv="" xmlns:ser="http://services.samples" xmlns:xsd="http://services.samples/xsd">

Analyzing the output

Observe the two Axis2 server instances. Both instances will receive the request, which was sent from the client.

Ouput of both Axis Server consoles: :: Generating quote for : foo

You don't get a response in the Soap Ui.