Message-driven beans, activation specifications, and listener ports
Guidelines, related to versions of WebSphere Application Server, to help choose when to configure your message-driven beans to work with listener ports rather than activation specifications.
We can configure the following resources for message-driven beans:
- Activation specifications for message-driven beans that comply with Java EE Connector Architecture (JCA) Version 1.5 and later.
- The message listener service, listener ports, and listeners for any message-driven beans to deploy against listener ports.
Activation specifications are the standardized way to manage and configure the relationship between an MDB running in WAS and a destination in IBM MQ. They combine the configuration of connectivity, the Java Message Service (JMS) destination and the runtime characteristics of the MDB, within a single object.
Activation specifications supersede the use of listener ports, which became a stabilized feature in WAS v7.0. There are several advantages to using activation specifications over listener ports:
- Activation specifications are simple to configure, because they only require two objects: the activation specification and a message destination. Listener ports require three objects: a connection factory, a message destination, and the message listener port itself.
- Activation specifications are not limited to the server scope. They can be defined at any administrative scope in WAS. Message listener ports must be configured at the server scope. This means that each server in a node requires its own listener port. For example, if a node is made up of three servers, three separate listener ports must be configured. Activation specifications can be configured at the node scope, so in the example only one activation specification would be needed.
- Activation specifications are part of the Java Platform, Enterprise Edition Connector Architecture 1.5 and 1.6 standards specification (JCA 1.5 and 1.6). Listener port support in WAS makes use of the application server facilities interfaces defined in the JMS specification, but is not part of any specification itself.
For WAS v7 and later, listener ports are stabilized. We should plan to migrate the IBM MQ message-driven bean deployment configurations from using listener ports to using activation specifications. For more information about how to configure activation specifications for non-ASF mode, see Configure activation specifications for non-ASF mode. However, we should not begin this migration until we are sure the application does not have to work on application servers earlier than WAS v7. For example, if we have an application server cluster with some members at v6.1 and some at a later version, we should not migrate applications on that cluster to use activation specifications until after we migrate all the application servers in the cluster to the later version. (ZOS) Also, when we migrate to activation specifications on the z/OS platform, enable the Control Region Adjunct (CRA) process of the application server (either by selecting Enable JCA based inbound message delivery on the JMS provider settings panel, or using the manageWMQ command to include starting the CRA process as part of starting an application server).
To use message-driven beans with a messaging provider that does not have a JCA Version 1.5 or 1.6 resource adapter, we cannot use activation specifications and therefore configure beans against a listener port. There are also a few scenarios in which, although we could use activation specifications, we might still choose to use listener ports. For example, for compatibility with existing message-driven bean applications. Here are some guidelines, related to versions of WAS, to help us choose when to use listener ports rather than activation specifications:
- WAS Version 4 does not support message-driven beans, so listener ports and activation specifications are not applicable. WAS Version 4 does support message beans, but these are not message-driven beans.
- WAS Version 5 supports EJB 2.0 (JMS only) message-driven beans deployed using listener ports. This deployment technology is sometimes called application server facility (ASF).
- WAS v6 continues to support message-driven beans deployed to use listener ports, and also supports JCA, which we can use to deploy message-driven beans that use activation specifications. This gives you the following options for deploying message-driven beans on WAS v6:
- You must deploy default messaging (service integration bus) message-driven beans to use activation specifications.
- We must deploy IBM MQ message-driven beans to use listener ports.
- We can deploy third-party messaging message-driven beans to use either listener ports or activation specifications, depending on the facilities available from your third-party messaging provider.
- WAS v7.0 or later continues to support the same options for message-driven bean deployment that WAS v6 supports, and adds a new option for IBM MQ message-driven beans. This gives you the following options for deploying message-driven beans on v7.0 or later:
- We must deploy default messaging (service integration bus) message-driven beans to use activation specifications.
- We can deploy new and existing IBM MQ message-driven beans to use listener ports (as on WAS v6) or to use activation specifications.
- We can deploy third-party messaging message-driven beans to use either listener ports or activation specifications, depending on the facilities available from your third-party messaging provider.
To assist in migrating listener ports to activation specifications, the WAS administrative console provides a Convert listener port to activation specification wizard on the Message listener port collection panel. This allows us to convert existing listener ports into activation specifications. However, this function only creates a new activation specification with the same configuration used by the listener port. It does not modify application deployments to use the newly created activation specification.
Related:
Message-driven beans - JCA components J2C activation specification configuration and use Message-driven beans - listener port components Migrate a listener port to an activation specification for use with the IBM MQ messaging provider Configure an activation specification for a third-party JCA resource adapter Configure an administered object for a third-party JCA resource adapter Manage message listener resources for message-driven beans Configure an activation specification for the default messaging provider Deploy an enterprise application to use message-driven beans with JCA 1.5-compliant resources Deploy an enterprise application to use message-driven beans with listener ports