具有多个实例的群集中的JMS持久订阅者 [英] JMS durable subscriber in a cluster with multiple instances

查看:226
本文介绍了具有多个实例的群集中的JMS持久订阅者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将使用Payara BTW ....

I am going to be using Payara BTW....

假设我有:


  1. JMS主题

  1. A JMS Topic

配置为持久主题订阅者的MDB

An MDB configured as a durable topic subscriber

在群集中部署了多个MDB实例,它们都使用相同的客户端ID值来进行持久订阅。

Multiple instances of the MDB are deployed across the cluster and they are all using the same client ID value to make the durable subscription.

如果是这种情况,并且考虑到客户ID值和持久订阅的工作方式,那么它是更正确的说,群集中只有一个MDB实例会成功连接,其他实例会失败吗?

If this is the scenario, and given the way client ID values and durable subscriptions work, is it correct to say that only 1 of the MDB instances across the cluster will succeed in connecting and the others will fail?

谢谢!

假设您已将MDB部署到群集,因此跨多个MDB实例群集试图监听。

Suppose you have a MDB deployed to a cluster, so there are multiple MDB instances across the cluster attempting to listen.

推荐答案

从JMS 2.0 API [1]开始,您可以跨节点共享相同的持久订阅应用程序集群。

As of the JMS 2.0 API [1], you can share the same durable subscription across nodes in an application cluster.


为了提高可扩展性,我们进行了以下更改:

The following change has been made to aid scalability:

现在允许应用程序在相同的持久或非持久主题订阅上创建多个使用者。在以前的JMS版本中,只允许一个使用者。

Applications are now permitted to create multiple consumers on the same durable or non-durable topic subscription. In previous versions of JMS only a single consumer was permitted.

您可以使用JMS 2.0+ API使用JMSContext.createSharedDurableConsumer()方法创建共享持久消费者[2]

You can use the JMS 2.0+ API to create a shared durable consumer using the JMSContext.createSharedDurableConsumer() methods [2]

[1] https ://java.net/projects/jms-spec/pages/JMS20FinalRelease#What_s_new_in_JMS_2.0 ? (?是链接的一部分 - 去图)

[1] https://java.net/projects/jms-spec/pages/JMS20FinalRelease#What_s_new_in_JMS_2.0? (the ? is part of the link - go figure)

[2] https://docs.oracle.com/javaee/7/api/javax/jms/ JMSContext.html #createSharedDurableConsumer-javax.jms.Topic-java.lang.String-

这篇关于具有多个实例的群集中的JMS持久订阅者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆