This section explains, through an example scenario, how the Event Message EIP can be implemented using the WSO2 ESB. The following topics are covered:
Table of Contents |
---|
...
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://ws.apache.org/ns/synapse"> <proxy name="EventMessageProxy" transports="https http" startOnLoad="true" trace="disable"> <target> <inSequence> <event topic="stockquote" /> </inSequence> <outSequence> <send /> </outSequence> </target> </proxy> </definitions> |
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:
- Download the
Event-Message_1.0.0.zip
file, which includes the ESB configuration described above. See Setting up the Environment for instructions on setting up the ESB and the back-end service.
Info 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.
- 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.
- Repeat the above steps to add another subscriber in port 9001.
Executing the sample
...