gpt4 book ai didi

java - JMS 主题中缺少消息

转载 作者:太空宇宙 更新时间:2023-11-04 12:42:52 31 4
gpt4 key购买 nike

我有一个使用两台托管服务器设置的 WebLogic (12.1.3) 集群。每个服务器都部署了相同的 EAR。 EAR 包含两个监听同一分布式 JMS 主题的消息驱动 Bean (MDB)。

每当一条消息发送到 JMS 主题时,只有一个 MDB 接收该消息。有人对可能的原因有什么建议吗?我怀疑这可能是 WebLogic 为 MDB 主题订阅提供的所有不同配置选项,但我已经尝试了所有我能想到的方法,但没有成功。

如有任何帮助,我们将不胜感激。

@MessageDriven for MDB1

@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName="destinationJndiName", propertyValue="jms/ObjectCreatedTopic"),
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="Durable"),
@ActivationConfigProperty(propertyName="topicMessagesDistributionMode", propertyValue="One-Copy-Per-Application"),
@ActivationConfigProperty(propertyName="distributedDestinationConnection", propertyValue="LocalOnly")
}, name="ObjectCreatedListener1")

@MessageDriven for MDB2

@MessageDriven(activationConfig = {
@ActivationConfigProperty(propertyName="destinationJndiName", propertyValue="jms/ObjectCreatedTopic"),
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(propertyName="subscriptionDurability", propertyValue="Durable"),
@ActivationConfigProperty(propertyName="topicMessagesDistributionMode", propertyValue="One-Copy-Per-Application"),
@ActivationConfigProperty(propertyName="distributedDestinationConnection", propertyValue="LocalOnly")
}, name="ObjectCreatedListener2")

最佳答案

我认为以下摘录自 weblogic documentation该主题适用于您(强调我的):

One-Copy-Per-Application topic MDBs that are durable, that subscribe to a local RDT, and that use the default LocalOnly value for the distributedDestinationConnection attribute, do not support Service Migration and require that exactly one topic member be configured per WebLogic Server instance. If a service migration occurs, if there is no local topic member configured, or if more than one topic member is deployed per server, then the application may experience duplicate or lost messages and may also create abandoned subscriptions that accumulate unprocessed messages. If service migration is required, then use the EveryMember option for the distributedDestinationConnection attribute instead of the default LocalOnly.

所以你已经知道了:设置的唯一可行的参数组合是

@ActivationConfigProperty(propertyName="topicMessagesDistributionMode", propertyValue="One-Copy-Per-Application")
@ActivationConfigProperty(propertyName="distributedDestinationConnection", propertyValue="EveryMember")

关于java - JMS 主题中缺少消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36656542/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com