[jgroups-dev] FW: Mux enabled dispatchers usage misunderstanding

Olexandr Markushyn <[email protected]> Thu, 4 Apr 2013 09:34:08 +0000
Newsgroups gmane.comp.java.javagroups.devel
Message-ID <[email protected]>
Greetings,

I see the reason is setting of muxUpHandler.defaultUpHandler to muxUpHandler at MessageDispatcher#installUpHandler.

Setting the defaultUpHandler to null helps to avoid double event processing.
muxUpHandler.setDefaultHandler( null );

Example with "muxUpHandler.setDefaultHandler( null );"
-----------
final Channel channel = new JChannel( configuration );
final MuxUpHandler muxUpHandler = new MuxUpHandler();
channel.setUpHandler( muxUpHandler );

final MessageDispatcher rpcDispatcher = new MuxRpcDispatcher( (short)1, channel, null, new MuxMembershipListener(), null );
final MessageDispatcher messageDispatcher = new MuxMessageDispatcher( (short)2, channel, null, new MuxMembershipListener(), null );

muxUpHandler.setDefaultHandler( null );

channel.connect( "MuxDispatchersMembershipListenerIssueTest" );

Output:
-------
----------------------------com.softcomputer.softweb.infl.commons.remoting.jgroups.connectivity.dispatch.mux.MuxDispatchersMembershipListenerIssueTest$MuxMembershipListener@59556d12, new_view=[IAMarkushin-23706|0] [IAMarkushin-23706]
----------------------------com.softcomputer.softweb.infl.commons.remoting.jgroups.connectivity.dispatch.mux.MuxDispatchersMembershipListenerIssueTest$MuxMembershipListener@776be68f, new_view=[IAMarkushin-23706|0] [IAMarkushin-23706]


Without "muxUpHandler.setDefaultHandler( null );" output looks like this:
----------
----------------------------com.softcomputer.softweb.infl.commons.remoting.jgroups.connectivity.dispatch.mux.MuxDispatchersMembershipListenerIssueTest$MuxMembershipListener@2f74219d, new_view=[IAMarkushin-46008|0] [IAMarkushin-46008]
----------------------------com.softcomputer.softweb.infl.commons.remoting.jgroups.connectivity.dispatch.mux.MuxDispatchersMembershipListenerIssueTest$MuxMembershipListener@714ae2c1, new_view=[IAMarkushin-46008|0] [IAMarkushin-46008]
----------------------------com.softcomputer.softweb.infl.commons.remoting.jgroups.connectivity.dispatch.mux.MuxDispatchersMembershipListenerIssueTest$MuxMembershipListener@714ae2c1, new_view=[IAMarkushin-46008|0] [IAMarkushin-46008]


Best regards,
Oleksandr Markushyn
Architectural Board Participant
ISD

From: Olexandr Markushyn
Sent: Wednesday, April 03, 2013 19:19
To: [email protected]
Cc: Olexandr Markushyn
Subject: Mux enabled dispatchers usage misunderstanding

Greetings,

Could you please help to clarify the situation on the next?

Context:
There are two mux enabled dispatcher instances.
They are of types MuxMessageDispatcher and MuxRpcDispatcher correspondingly.
Each one has registered personal MembershipListener instance.
Channel is configured with MuxUpHandler.

Problem:
When viewAccepted event arises MembershipListener#viewAccepted of MuxRpcDispatcher is called twice and MembershipListener#viewAccepted of MuxMessageDispatcher is not called at all.

Best regards,
Oleksandr Markushyn
Architectural Board Participant
ISD

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html

_______________________________________________
Javagroups-development mailing list