In this sample an event source is creted based on the provided configuration. Event subscriber subscribes for the events, Event sender publishes events and the SimpleStockQuoteService acts as the Event Sink.
First, invoke the sample client (Subscriber) as follows.
This will create a new subscription with the SimpleStockQuoteService deployed on the sample Axis2 server acting as the sink. Whenever a new event is published, SimpleStockQuoteService will receive a message with that event. You should see a message like this on the client console confirming the subscription.
You will need this identifier to modify the subscription in the next steps. Now, invoke the client (Sender) as follows.
This will send a placeOrder request to the EventingProxy. You should see a message in the Synapse logs. Note the presence of the following SOAP header in the request.
Since there is a single subscription with SimpleStockQuoteService as the sink, Synapse will send the message to the sample Axis2 server and you should see the following message in its logs:
You can also send various other WS-Eventing messages from the sample client to modify the subscription details. To get the current status of the subscription, invoke the client as follows.
To renew the subscription, invoke the client as follows.
Finally, in order to unsubscribe, use the following command.