Question

I am new to JBOSS. I am trying to write an mBean that will communicate from within the AS across a multicast channel using JGroups. The code I'm using in my mBean is below...

public void create() throws Exception {
channel=new JChannel("test/udp.xml");
channel.connect("ChatCluster");

}

public void sendMsg() throws ChannelNotConnectedException,  
                                       ChannelClosedException {
 channel.send(new org.jgroups.Message(
                     null,null, "hello from the server!"));

}

I also created a client that is listening on the channel, but the two are not communicating .. Here is the XML for the channel ..

<UDP
     mcast_port="45700"
     mcast_addr="224.0.0.11"
     tos="8"
     ucast_recv_buf_size="20000000"
     ucast_send_buf_size="640000"
     mcast_recv_buf_size="25000000"
     mcast_send_buf_size="640000"
     loopback="true"
     discard_incompatible_packets="true"
     max_bundle_size="64000"
     max_bundle_timeout="30"
     ip_ttl="${jgroups.udp.ip_ttl:32}"
     enable_bundling="true"
     enable_diagnostics="true"
     thread_naming_pattern="cl"

     thread_pool.enabled="true"
     thread_pool.min_threads="2"
     thread_pool.max_threads="8"
     thread_pool.keep_alive_time="5000"
     thread_pool.queue_enabled="true"
     thread_pool.queue_max_size="10000"
     thread_pool.rejection_policy="discard"

     oob_thread_pool.enabled="true"
     oob_thread_pool.min_threads="1"
     oob_thread_pool.max_threads="8"
     oob_thread_pool.keep_alive_time="5000"
     oob_thread_pool.queue_enabled="false"
     oob_thread_pool.queue_max_size="100"
     oob_thread_pool.rejection_policy="Run"/>

Any help would be greatly appreciated as I have spent some tie on this and am trying to figure this out. I would prefer to use some other echanism for communication, however I am limited to just using multicast ... long story..

Thanks!!!

~Bolt

Was it helpful?

Solution 2

It turned out that I had multiple NIC cards on my system, so I set the flag receive_on_all_interfaces="true".

OTHER TIPS

Is your network set up for multicast ? The JGroups documentation has several pointers re. stuff not working, and some test programs. See the Installation Guide, section 2.6 on. If your network is ok, then the simple

java org.jgroups.demos.Draw

program should work out of the box. If that is the case, I would take a known-to-be-good JGroups configuration, and configure your system with that, and work from there.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top