JBOSS AppServer 和客户端之间通过多播进行通信

发布于 2024-08-08 18:49:59 字数 1704 浏览 10 评论 0原文

我是 JBOSS 的新手。我正在尝试编写一个 mBean,它将使用 JGroups 在 AS 内部通过多播通道进行通信。我在 mBean 中使用的代码如下...

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!"));

}

我还创建了一个正在侦听通道的客户端,但两者没有进行通信.. 这是通道的 XML ..

<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"/>

任何帮助都会非常有用很感激,因为我在这方面花了一些领带,并正在努力解决这个问题。我更愿意使用其他一些机制进行通信,但是我仅限于使用多播......长话短说......

谢谢!

~博尔特

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

给不了的爱 2024-08-15 18:49:59

您的网络是否设置为多播? JGroups 文档有几个相关的指针。东西不起作用,还有一些测试程序。请参阅安装指南,第 2.6 节。如果您的网络正常,那么这个简单的

java org.jgroups.demos.Draw

程序应该可以开箱即用。如果是这种情况,我会采用已知良好的 JGroups 配置,并用它配置您的系统,然后从那里开始工作。

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.

本王不退位尔等都是臣 2024-08-15 18:49:59

原来我的系统上有多个网卡,所以我设置了标志 receive_on_all_interfaces="true"。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文