Part 7 : Testing the scenario end-to-end
Deploy the SampleWebServiceModuleApp" first and then the "TimerMediationModuleApp". You would see similar output on the WID console, as in Figure 32.
This shows that a task with taskID 104 was created by our startup bean, which posts a message to the SampleSIBus. It also indicates that the SampleSIBus is picked up by the TimerMediationModule, which in turn invokes the SampleWebServiceModule, which prints the statement saying it received the request with the exact timestamp value sent by the TimerMediationModule, and the response flow of the TimerMediationModule prints the final statement saying "End of Flow".
The last two statements would be printed periodically each minute, which can be concluded by looking at the time difference in timestamps, which would be one minute and which was specified as the interval for the task.
Figure 32. SystemOut Console
Conclusion
We successfully implemented a proactive mediation module, which can poll an external Web service periodically on a given time interval and can fetch updates. Posting the updates to the external subscribers can easily be implemented by the "publish-subscribe" mechanism.
|