Search code examples
javajakarta-eejmsweblogic12cmessage-driven-bean

Missing Message from JMS Topic


I have a WebLogic (12.1.3) cluster set up with two managed servers. Each server has the same EAR deployed to it. The EAR contains two message-driven beans (MDB) listening to the same distributed JMS topic.

Whenever a message is sent to the JMS topic, only one of the MDBs receives it. Does anyone have a suggestion of what the cause might be? I suspect it could be all of the different configuration options that WebLogic has for MDB topic subscriptions, but I have tried all that I can think of without success.

Any help would be appreciated.

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

Solution

  • I think the following excerpt from the weblogic documentation on the topic applies to you (emphasis mine):

    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.

    So there you have it: the only viable combination of parameters for your setup is

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