This section explains, through an example scenario, how the Event Message EIP can be implemented using the ESB profile of WSO2 EI. 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> |
How the implementation works
Let's investigate the elements of the configuration in detail. The line numbers below are mapped with the configuration shown above.
- Event [line 12 of config] - Sends incoming events to the topics that you created earlier.
Simulating the sample scenario
Now, let's try out the sample scenario explained above.
Setting up the environment
- Download the
Event-Message_1.0.0.zip
, which includes the artifacts of this sample and follow the steps in Setting up the EnvironmentSimulating a Sample Scenario. - Follow the steps below to create an event.
- Start the ESB profile and log into its Management Console. For instructions, see Starting the ESB profile in WSO2 EI Documentation.
- Select the Topics menu from the Main menu, and then select the Add sub menu.
- Enter the name
stockquote
for the topic and then click Add Topic. - In the Topic Browser tree, click the newly created
stockquote
topic and then click Subscribe to create a static subscription. - Enter the value
http://localhost:9000/services/SimpleStockQuoteService
in the Event Sink URL field and click Subscribe. - Repeat these steps to add another subscriber in port 9001.
Executing the sample
...