We have some issues while broadcasting messages as part of a
From wlst, we are invoking a MBean of source instance. In wlst, we have a
listener attached to the source MBean and we listen for the notification
messages and print them in the console.
The source Mbean invokes another bean of another instance (target instance).
While invoking the mbean of the target instance, we have attached a
notification listener (TargetListener) to the target mbean connection and
listening for messages.
We want to broad cast these messages that we receive from the target mbean as
a message to the source Mbean (as and when we receive the messages from the
target) in the TargetListener.
In the handleNotification method of the TargetListener, we are trying to
broadcast messages. This braodcasting message internally happens in a thread
which is started by the handle notification method as and when it receives
the messages. Threading is done in order to avoid blocking of notification
We get all the messages in the wlst console , but the messages that
we receive from the TargetListener are not received progressively .
All the messages are sent at one shot (one after another after the target
mbean operation is completed) .
Even though we invoke the broadcaster as and when we receive the messages
(in a thread), the actual broadcasting happens only after the target mbean
operation is completed.
Broadcasting of messages from the target mbean (to the source mbean) needs
to be synchronous when the target mbean is invoked by the source mbean.