Problems with Internode communication using Jgroups

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problems with Internode communication using Jgroups

mnadeem
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Kudoos for such a wonderful framework......

I was having tough time making atmosphere work in a clustered environment, if we can solve this issue, then it could be the right framework for the enterprise.

Ideally in a clustered (more than one node) environment JGroupsBroadcaster.broadcast(message) should broadcast message not only to other clusters but also to all the suspended resources, However with the current implementations  of AbstractBroadcasterProxy it does not look so, it only publishes to other clusters using the underlying mechanism (jgroups, jms, rmi etc). What would be expected is all the suspended resources in the current node and also other nodes should also be notified.
<br />

 Couple of other observations for Jgroups implementation of AbstractBroadcasterProxy
===================================================================
<br />

1) Lots of channels are created unnecessarily both from JGroupsBroadcaster and JGroupsFilter
2) JGroupsBroadcaster  should be configurable for jgroups properties, further JChannel is crated with default protocol stack, more over Channel is created in the incoming, not for outgoing.
<br />
 <code> public void incomingBroadcast() {
        try {
            logger.info("Starting Atmosphere JGroups Clustering support with group name {}", getID());

            jchannel = new JChannel();
            jchannel.setReceiver(new ReceiverAdapter() {
                /** {@inheritDoc} */
                @Override
                public void receive(final Message message) {
                    final Object msg = message.getObject();
                    if (msg != null && BroadcastMessage.class.isAssignableFrom(msg.getClass())) {
                        BroadcastMessage b = BroadcastMessage.class.cast(msg);
                        if (b.getTopicId().equalsIgnoreCase(getID())) {
                            broadcastReceivedMessage(b.getMessage());
                        }
                    }
                }
            });
            jchannel.connect(getID());
        } catch (Throwable t) {
            logger.warn("failed to connect to JGroups channel", t);
        } finally {
            ready.countDown();
        }
    }</code>

<br />
3) Unnecessary/incorrect use of CountDownLatch in JGroupsBroadcaster
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with Internode communication using Jgroups

mnadeem
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Well I believe, I have resolved the issue, I will post the details soon
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problems with Internode communication using Jgroups

mnadeem
This post has NOT been accepted by the mailing list yet.
The main issue is both JGroupsBroadcaster and JGroupsFilter try to connect to jchannel and JGroupsBroadcaster broadcasts to just the jchannel, where as DefaultBRoadcaster (JGroupsFilter ) resumes suspended resources and sends the the message to jchannel using JGroupsFilter.

Now the problem is if we include atmosphere-jgroups, JGroupsBroadcaster  would be used instead of DefaultBroadcaster.

Refer this working example
Loading...