缺少来自 JMS 主题的消息

Missing Message from JMS Topic

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

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

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

@MDB1 的 MessageDriven

@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")

@MDB2 的 MessageDriven

@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")