Patent ID: 7624144

Claim:
A method comprising: processing program code with one or more computer processors to perform the following: ensuring that an onMessage( ) method is invoked on only one message-driven bean (MDB) instance within a server cluster for a message directed to a particular Java Messaging Service (JMS) topic destination within a publish-and-subscribe model, by performing the following: receiving a request from a server within a server cluster, the server having a first bean container capable of containing a plurality of message driver beans (MDB)s, the request to register the server as a message listener for a particular Java Message Service (JMS) topic destination within a publish-and-subscribe model; determining that no other servers within the server cluster are registered as listeners for the particular JMS topic destination; registering the server as the message listener for the JMS topic destination responsive to the request; while the server is registered as the message listener for the JMS topic destination, locking out other servers in the cluster that send requests to be registered as message listeners for the JMS topic destination, forwarding a message for the JMS topic destination to the server and processing the message by invoking an onMessage( ) method on an MDB instance within the server; and, in response to the server becoming inoperative: selecting one of the other servers within the cluster as the registered server for the JMS topic destination; and, forwarding a subsequent message for the JMS topic destination to the other servers and processing a second subsequent message for the JMS topic destination by invoking an onMessage( ) method on another MDB instance within the other servers.