Hi Devs,

This thread is to discuss $subject.

Let me explain the current flow, taking Topology event listener in Stratos
Manager as an example.

   1. SM Topology event receiver is started in a separate thread
   2. In the SM Topology event receiver thread, we start another thread
   with an instance of messaging's TopologyEventReceiver class.
   3. Again in the TopologyEventReceiver thread, we create couple of more
   threads for the Topology event message delegator and topic subscriber.

IMHO there is no need to create all these threads. AFAIU, what we need are
three threads which will:

   1. Listen to the events
   2. Handles delegation
   3. Updates the local topology models

Also, we can use java ExecutorServices handle graceful starting/termination
of threads. Currently, we are doing sleeping/looping mechanism to keep the
threads alive, which can be replaced with ExecutorService.

WDYT?
-- 
Thanks and Regards,

Isuru H.
+94 716 358 048* <http://wso2.com/>*

Reply via email to