Este conteúdo não está disponível no idioma selecionado.
Chapter 31. Resource Adapters
A Jakarta Connectors Resource Adapter lets your applications communicate with any messaging provider. It configures how Jakarta EE components such as MDBs and other Jakarta Enterprise Beans, and even Servlets, can send or receive messages.
31.1. About the Integrated Artemis Resource Adapter Copiar o linkLink copiado para a área de transferência!
JBoss EAP 7 includes an integrated Artemis resource adapter, which uses the pooled-connection-factory element to configure the outbound and inbound connections of the resource adapter.
Outbound Connection
Outbound connections are defined using the pooled-connection-factory element, which is then used in Jakarta EE deployments by Jakarta Enterprise Beans and servlets to send messages to and receive messages from queues or topics. Because connections created from connection factories are created in the scope of the application server, they can use application server features like the following:
- Connection pooling
- Authentication using the security domains defined by the application server
- Participation in XA transactions using the transaction manager
This is a major difference with a pooled-connection-factory as these features are not available with a basic connection-factory like InVmConnectionFactory or RemoteConnectionFactory. Also, be aware that with a connection factory defined using pooled-connection-factory, it is not possible to do a lookup using JNDI from an external standalone JMS client.
Inbound Connections
Inbound connections are used only by message-driven beans (MDBs) to receive message from a queue or a topic. MDBs are stateless session beans that listen on a queue or topic. They must implement the public onMessage(Message message) method, which is called when a message is sent to a queue or a topic. The Artemis resource adapter is responsible for receiving the message from the queue or the topic and passing it to the onMessage(Message message) method. For this purpose it configures the inbound connection, which defines the location of the integrated Artemis server and some additional elements.
Each MDB session bean uses a thread from the client thread pool to consume the message from the destination. If the maximum pool size is not defined, it is determined to be eight (8) times the number of CPU core processors. For systems with many MDB sessions, such as test suites, this can potentially lead to thread exhaustion and force MDBs to wait for a free thread from the pool. You can increase the maximum pool size of client thread pool using the management CLI. The following command sets the maximum client thread pool size to 128.
/subsystem=messaging-activemq:write-attribute(name=global-client-thread-pool-max-size,value=128)
/subsystem=messaging-activemq:write-attribute(name=global-client-thread-pool-max-size,value=128)
For information about how to configure the client thread pool size, see Client Thread Management. For more information about MDBs, see Message Driven Beans in Developing EJB Applications for JBoss EAP.
31.2. Using the Integrated Artemis Resource Adapter for Remote Connections Copiar o linkLink copiado para a área de transferência!
JBoss EAP includes a resource adapter to make connections to its integrated ActiveMQ Artemis messaging server. By default the pooled-connection-factory defined in the messaging-activemq subsystem uses the adapter to make the connections. However, you can use the same resource adapter to make connections to an Artemis server running inside a remote instance of JBoss EAP as well.
The activemq-ra pooled connection factory, which is configured by default in the messaging-activemq subsystem, has the java:jboss/DefaultJMSConnectionFactory entry assigned. This entry is required by the messaging-activemq subsystem. If you decide to remove the activemq-ra pooled connection factory, you must assign this entry to a different connection factory. Otherwise you will see the following error in the server log on deployment.
WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.DefaultJMSConnectionFactory"]
WFLYCTL0412: Required services that are not installed:" => ["jboss.naming.context.java.jboss.DefaultJMSConnectionFactory"]
To connect to an Artemis server running inside a remote instance of JBoss EAP, create a new pooled-connection-factory by following the steps below.
Create an outbound-socket-binding pointing to the remote messaging server:
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-server:add(host=<server host>, port=8080)
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-server:add(host=<server host>, port=8080)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a remote-connector referencing the outbound-socket-binding created in step 1.
/subsystem=messaging-activemq/server=default/http-connector=remote-http-connector:add(socket-binding=remote-server,endpoint=http-acceptor)
/subsystem=messaging-activemq/server=default/http-connector=remote-http-connector:add(socket-binding=remote-server,endpoint=http-acceptor)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pooled-connection-factory referencing the remote-connector created in step 2.
/subsystem=messaging-activemq/server=default/pooled-connection-factory=remote-artemis:add(connectors=[remote-http-connector], entries=[java:/jms/remoteCF])
/subsystem=messaging-activemq/server=default/pooled-connection-factory=remote-artemis:add(connectors=[remote-http-connector], entries=[java:/jms/remoteCF])Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteArtemis 1.x required a prefix on destination names (jms.topic for topics and jms.queue for queues). Artemis 2.x does not require prefixes, but for compatibility with Artemis 1.x, EAP still adds the prefix and directs Artemis to run in compatibility mode. If you connect to a remote Artemis 2.x server, it may not be in compatibility mode and you may not need the prefixes. When using destinations without a prefix, you can configure the connection factory not to include the prefixes by setting the attribute
enable-amq1-prefixto false.
Configuring an MDB to use a pooled-connection-factory
After the pooled-connection-factory is configured to connect to a remote Artemis server, Message-Driven Beans (MDB) wanting to read messages from the remote server must be annotated with the @ResourceAdapter annotation using the name of the pooled-connection-factory resource.
If the MDB needs to send messages to the remote server, it must inject the pooled-connection-factory by looking it up using one of its JNDI entries.
@Inject
@JMSConnectionFactory("java:/jms/remoteCF")
private JMSContext context;
@Inject
@JMSConnectionFactory("java:/jms/remoteCF")
private JMSContext context;
Configuring the JMS destination
An MDB must also specify the destination from which it will consume messages. The standard way to do this is to define a destinationLookup activation config property that corresponds to a JNDI lookup on the local server.
If the local server does not include a JNDI binding for the remote Artemis server, specify the name of the destination, as configured in the remote Artemis server, using the destination activation config property and set the useJNDI activation config property to false. This instructs the Artemis resource adapter to automatically create the JMS destination without requiring a JNDI lookup.
In the above example, the activation config properties configure the MDB to consume messages from the JMS Queue named myQueue hosted on the remote Artemis server. In most cases, the MDB does not need to lookup other destinations to process the consumed messages, and it can use the JMSReplyTo destination if it is defined on the message.
If the MDB needs any other JMS destinations defined on the remote server, it must use client-side JNDI. See Connecting to a Server for more information.
31.3. Configuring the Artemis Resource Adapter to Connect to Red Hat AMQ Copiar o linkLink copiado para a área de transferência!
You can configure the integrated Artemis resource adapter to connect to a remote installation of Red Hat AMQ 7, which then becomes the JMS provider for your JBoss EAP 7.3 applications. This allows JBoss EAP to be a client for the remote Red Hat AMQ 7 server.
If you require support for other messaging protocols, such as AMQP or STOMP, you must configure Red Hat AMQ 7 as your messaging broker. The Artemis resource adapter integrated in the JBoss EAP server can then be used to process messages for the deployed applications.
Limitations of the Integrated Resource Adapter
Dynamic Creation of Queues and Topics
Be aware that the Artemis resource adapter that is integrated in JBoss EAP 7.3 does not support dynamic creation of queues and topics in the Red Hat AMQ 7 broker. You must configure all queue and topic destinations directly on the remote Red Hat AMQ 7 server.
Creation of Connection Factories
Although Red Hat AMQ allows connection factories to be configured using both the pooled-connection-factory and the external-context, there is a difference in the way each connection factory is created. When the external-context is used to create the connection factory, it creates simple JMS connection factory as defined in the JMS specification. The newly created connection factory is equivalent to the RemoteConnectionFactory, which is defined by default in messaging-activemq subsystem. This connection factory is independent of the other components in the application server, meaning it is not aware of, nor is it able to use, other components like the transaction manager or the security manager. For this reason, only the pooled-connection-factory can be used to create connection factories in JBoss EAP 7. The external-context can only be used to register JMS destinations, which are already configured on the remote AMQ 7 broker, into the JNDI tree of the JBoss EAP 7 server so that local deployments can look them up or inject them.
Connection factories created by configuring the external-context or the connection-factory elements cannot be used to connect to the remote AMQ 7 broker as they do not use the Artemis resource adapter. Only connection factories created by configuring the pooled-connection-factory element are supported for use when connecting to the remote AMQ7 broker.
Configure JBoss EAP to Use a Remote Red Hat AMQ Server
You can use the management CLI to configure JBoss EAP to use a remote installation of Red Hat AMQ 7 as the messaging provider by following the steps below:
Configure the queue in the Red Hat AMQ 7
broker.xmldeployment descriptor file.Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe Artemis resource adapter that is included with JBoss EAP uses the ActiveMQ Artemis JMS Client 2.x. This client requires
anycastPrefixandmulticastPrefixprefixing on the address. It also expects the queue name to be the same as the address name.Create the remote connector.
/subsystem=messaging-activemq/remote-connector=netty-remote-throughput:add(socket-binding=messaging-remote-throughput)
/subsystem=messaging-activemq/remote-connector=netty-remote-throughput:add(socket-binding=messaging-remote-throughput)Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates the following
remote-connectorin themessaging-activemqsubsystem.<subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0"> ... <remote-connector name="netty-remote-throughput" socket-binding="messaging-remote-throughput"/> ... </subsystem><subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0"> ... <remote-connector name="netty-remote-throughput" socket-binding="messaging-remote-throughput"/> ... </subsystem>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the remote destination outbound socket binding.
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=messaging-remote-throughput:add(host=localhost, port=61616)
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=messaging-remote-throughput:add(host=localhost, port=61616)Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates the following
remote-destinationin theoutbound-socket-bindingelement configuration.<outbound-socket-binding name="messaging-remote-throughput"> <remote-destination host="localhost" port="61616"/> </outbound-socket-binding><outbound-socket-binding name="messaging-remote-throughput"> <remote-destination host="localhost" port="61616"/> </outbound-socket-binding>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a pooled connection factory for the remote connector.
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(transaction=xa,entries=[java:/RemoteJmsXA, java:jboss/RemoteJmsXA],connectors=[netty-remote-throughput])
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(transaction=xa,entries=[java:/RemoteJmsXA, java:jboss/RemoteJmsXA],connectors=[netty-remote-throughput])Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates the following
pooled-connection-factoryin themessaging-activemqsubsystem.<subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0"> ... <pooled-connection-factory name="activemq-ra-remote" entries="java:/RemoteJmsXA java:jboss/RemoteJmsXA" connectors="netty-remote-throughput"/> ... </subsystem><subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0"> ... <pooled-connection-factory name="activemq-ra-remote" entries="java:/RemoteJmsXA java:jboss/RemoteJmsXA" connectors="netty-remote-throughput"/> ... </subsystem>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteArtemis 1.x required a prefix on destination names (jms.topic for topics and jms.queue for queues). Artemis 2.x does not require prefixes, but for compatibility with Artemis 1.x, EAP still adds the prefix and directs Artemis to run in compatibility mode. If you connect to a remote Artemis 2.x server, it may not be in compatibility mode and you may not need the prefixes. When using destinations without a prefix, you can configure the connection factory not to include the prefixes by setting the attribute
enable-amq1-prefixto false.Create the
external-contextbindings for the queues and topics./subsystem=naming/binding=java\:global\/remoteContext:add(binding-type=external-context, class=javax.naming.InitialContext, module=org.apache.activemq.artemis, environment=[java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory, java.naming.provider.url=tcp://127.0.0.1:61616, queue.MyQueue=MyQueue, queue.MyOtherQueue=MyOtherQueue, topic.MyTopic=MyTopic])
/subsystem=naming/binding=java\:global\/remoteContext:add(binding-type=external-context, class=javax.naming.InitialContext, module=org.apache.activemq.artemis, environment=[java.naming.factory.initial=org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory, java.naming.provider.url=tcp://127.0.0.1:61616, queue.MyQueue=MyQueue, queue.MyOtherQueue=MyOtherQueue, topic.MyTopic=MyTopic])Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates the following
external-contextbindings in thenamingsubsystem.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the lookup entry for the JMS queues and topics by setting the JNDI name to the Red Hat AMQ 7 address name value. This creates a mapping between the JNDI name and the Red Hat AMQ 7 address name.
/subsystem=naming/binding=java\:\/MyQueue:add(lookup=java:global/remoteContext/MyQueue,binding-type=lookup) /subsystem=naming/binding=java\:\/MyOtherQueue:add(lookup=java:global/remoteContext/MyOtherQueue,binding-type=lookup) /subsystem=naming/binding=java\:\/MyTopic:add(lookup=java:global/remoteContext/MyTopic,binding-type=lookup)
/subsystem=naming/binding=java\:\/MyQueue:add(lookup=java:global/remoteContext/MyQueue,binding-type=lookup) /subsystem=naming/binding=java\:\/MyOtherQueue:add(lookup=java:global/remoteContext/MyOtherQueue,binding-type=lookup) /subsystem=naming/binding=java\:\/MyTopic:add(lookup=java:global/remoteContext/MyTopic,binding-type=lookup)Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates the following
lookupconfigurations in thenamingsubsystem.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Alternatively, define the
/subsystem=messaging-activemq/external-jms-queueor the/subsystem=messaging-activemq/external-jms-topicresource instead of configuring naming subsystem. For example:/subsystem=messaging-activemq/external-jms-queue=MyQueue:add(entries=[java:/MyQueue])
/subsystem=messaging-activemq/external-jms-queue=MyQueue:add(entries=[java:/MyQueue])Copy to Clipboard Copied! Toggle word wrap Toggle overflow This creates the following resource:
<subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0"> ... <external-jms-queue name="MyQueue" entries="java:/MyQueue"/> ... </subsystem><subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0"> ... <external-jms-queue name="MyQueue" entries="java:/MyQueue"/> ... </subsystem>Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe
external-jms-queueresource does not provide operations for queue management and statistics.
JBoss EAP is now configured to use the remote installation of Red Hat AMQ 7 as the messaging provider.
31.4. JMS Resources Configuration for a Remote Artemis-based Broker Copiar o linkLink copiado para a área de transferência!
From the management CLI, you can configure JMS resources for a remote Artemis-based broker, such as Red Hat AMQ 7, using the @JMSConnectionFactoryDefinition annotation or the @JMSDestinationDefinition annotation. You can also configure the resources from the management console.
The remote ActiveMQ server resources do not require a local instance of Artemis. This helps reduce the memory and CPU footprint of the JBoss EAP image.
31.4.1. JMS Resources Configuration Using the JMSConnectionFactoryDefinition Annotation Copiar o linkLink copiado para a área de transferência!
JBoss EAP uses the @JMSConnectionFactoryDefinition annotation to define a connection factory. This connection factory can connect to a local or a remote Artemis broker. The resourceAdapter element of the @JMSConnectionFactoryDefinition annotation then refers to the name of the pooled-connection-factory defined in the messaging-subsystem which can connect to a remote Artemis broker. The resourceAdapter element defines which resource adapter is used for creating a connection factory or in which resource adapter a connection factory is defined.
When the resourceAdapter element is not defined in the @JMSConnectionFactoryDefinition annotation, the messaging-activemq subsystem uses the JNDI name of the connection factory by default. This is known as default binding. The default binding is defined using the jms-connection-factory attribute at /subsystem=ee/service=default-bindings. If the resourceAdapter element is specified or one can be defined from the default binding for the jms-connection-factory and if it is a pooled-connection-factory to a remote broker, you can use it to connect to the remote broker.
If the resourceAdapter is not defined in the messaging-activemq subsystem or one cannot be obtained from the default binding for the jms-connection-factory, the task of creating the JMS resources is delegated to the resource-adapters subsystem based on the resource adapter’s admin-objects and connection-definitions resources.
The following sections provide examples of how to configure and use the @JMSConnectionFactoryDefinition annotation.
Configuring @JMSConnectionFactoryDefinition Using the Default Resource Adapter
Create a connector:
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pooled connection factory:
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"]
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"]Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define the default JMS connection factory for the
eesubsystem:/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")
/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
@JMSConnectionFactoryDefinitionannotation in your application code:@JMSConnectionFactoryDefinition( name="java:app/myCF"@JMSConnectionFactoryDefinition( name="java:app/myCF"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring @JMSConnectionFactoryDefinition Using a Remote Artemis Broker
Create a connector:
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pooled connection factory:
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"])
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"])Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define the default JMS connection factory for the
eesubsystem:/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")
/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
@JMSConnectionFactoryDefinitionannotation in your application code:@JMSConnectionFactoryDefinition( name="java:app/myCF" resourceAdapter="myPCF" )@JMSConnectionFactoryDefinition( name="java:app/myCF" resourceAdapter="myPCF" )Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring @JMSConnectionFactoryDefinition Using a Third-party JMS Resource Adapter
Create a connector:
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pooled connection factory:
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"])
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"])Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define the default JMS connection factory for the
eesubsystem:/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")
/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
@JMSConnectionFactoryDefinitionannotation in your application code:@JMSConnectionFactoryDefinition( name="java:app/myCF" resourceAdapter="wsmq" )@JMSConnectionFactoryDefinition( name="java:app/myCF" resourceAdapter="wsmq" )Copy to Clipboard Copied! Toggle word wrap Toggle overflow
31.4.2. JMS Resources Configuration Using the JMSDestinationDefinition Annotation Copiar o linkLink copiado para a área de transferência!
You can use the server resources to create the required destinations for a pooled-connection-factory to a local broker.
If the resourceAdapter element points to a pooled-connection-factory name and it is defined in a local broker, for example, /subsystem/messaging-activemq/server=default, then it creates destinations in the local Artemis broker.
If you need to create destinations in a remote Artemis-based broker, then the pooled-connection-factory must be defined in the messaging-activemq subsystem.
If the resourceAdapter set in the @JMSDestinationDefinition annotation matches the resourceAdapter element defined for the server in the messaging-activemq subsystem, then the destination is created in this broker, irrespective of whether the connector in the pooled-connection-factory points to a local or a remote Artemis broker.
Configuring JMS Resources Using the JMSDestinationDefinition Annotation
Create a connector:
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")
/subsystem=messaging-activemq/remote-connector=remote-amq:add(socket-binding="messaging-remote-throughput")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a pooled connection factory:
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"])
/subsystem=messaging-activemq/pooled-connection-factory=activemq-ra-remote:add(entries=["java:/jms/remote-amq/JmsConnectionFactory"],connectors=["remote-amq"])Copy to Clipboard Copied! Toggle word wrap Toggle overflow Define the default JMS connection factory for the
eesubsystem:/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")
/subsystem=ee/service=default-bindings:write-attribute(name=jms-connection-factory, value="java:/jms/remote-amq/JmsConnectionFactory")Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use the
@JMSDestinationDefinitionannotation in your application code:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
31.4.3. Configuring Remote ActiveMQ Server Resources Using the Management Console Copiar o linkLink copiado para a área de transferência!
You can configure the following remote ActiveMQ server resources from the management console:
- Generic Connector
- In VM Connector
- HTTP Connector
- Remote Connector
- Discovery Group
- Connection Factory
- Pooled Connection Factory
- External JMS Queue
- External JMS Topic
To configure the remote ActiveMQ server resources from the management console:
-
Access the management console and navigate to Configuration
Subsystems Messaging (ActiveMQ) Remote ActiveMQ Server and click View. - In the navigation pane, click the resource you want to configure.
31.5. Deploying a Red Hat JBoss A-MQ Resource Adapter Copiar o linkLink copiado para a área de transferência!
You can deploy the resource adapter provided by the Red Hat JBoss A-MQ product and have, for example, Red Hat JBoss A-MQ 6.3.0, become the external JMS provider for JBoss EAP.
See Install the ActiveMQ Resource Adapter in Integrating with JBoss Enterprise Application Platform, which is in the Red Hat JBoss A-MQ documentation suite, for details on how to deploy and configure a Red Hat JBoss A-MQ resource adapter.
Be aware that the product name changed from Red Hat JBoss A-MQ in the 6.x releases to Red Hat AMQ in the 7.x releases.
31.5.1. Issues with the Red Hat JBoss A-MQ 6 Resource Adapter Copiar o linkLink copiado para a área de transferência!
JBoss EAP will track and monitor applications, looking for unclosed resources. While useful in many cases, such monitoring might cause unexpected behavior when an application tries to re-use a closed instance of
UserTransactionin a single method. Add the attributetracking="false"to the<connection-definition/>element when configuring the Red Hat JBoss A-MQ resource adapter if your applications re-use connections in this way.<connection-definition class-name="..." tracking="false" ... />
<connection-definition class-name="..." tracking="false" ... />Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The Red Hat JBoss A-MQ 6 resource adapter does not implement
XAResourceWrapperfrom the Narayana API, which is used by JBoss EAP. Consequently, when the Transaction Manager sends a commit to all the XA transaction participants and then crashes while waiting for a reply, it will go on indefinitely logging warnings until records of the committed transaction are removed from its object store. The Red Hat JBoss A-MQ 6 resource adapter returns the code
XAER_RMERRwhen an error, such as a network disconnection, occurs during the call of the commit method protocol. This behavior breaks the XA specification since the correct return code should beXAER_RMFAILorXAER_RETRY. Consequently, the transaction is left in an unknown state on the message broker side, which can cause data inconsistency in some cases. A message will be logged similar to the one below when the unexpected error code is returned.WARN [com.arjuna.ats.jtax] ...: XAResourceRecord.rollback caused an XA error: ARJUNA016099: Unknown error code:0 from resource ... in transaction ...: javax.transaction.xa.XAException: Transaction ... has not been started.
WARN [com.arjuna.ats.jtax] ...: XAResourceRecord.rollback caused an XA error: ARJUNA016099: Unknown error code:0 from resource ... in transaction ...: javax.transaction.xa.XAException: Transaction ... has not been started.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Red Hat JBoss A-MQ 6.x supports the JMS 1.1 specification that is included with Java EE 6. It does not support the JMS 2.0 specification that was introduced in Java EE 7 and is supported in JBoss EAP 7. If you need to send messages to a remote Red Hat JBoss A-MQ broker, you must use the JMS 1.1 API within your application code. For more information about Red Hat JBoss A-MQ 6.x supported standards, see Red Hat JBoss A-MQ Supported Standards and Protocols.
31.6. Deploying the IBM MQ Resource Adapter Copiar o linkLink copiado para a área de transferência!
About IBM MQ
IBM MQ is the Messaging Oriented Middleware (MOM) product offering from IBM that allows applications on distributed systems to communicate with each other. This is accomplished through the use of messages and message queues. IBM MQ is responsible for delivering messages to the message queues and for transferring data to other queue managers using message channels. For more information about IBM MQ, see IBM MQ on the IBM products website.
Summary
IBM MQ can be configured as an external JMS provider for JBoss EAP 7.3. This section covers the steps to deploy and configure the IBM MQ resource adapter in JBoss EAP. This deployment and configuration can be accomplished by using the management CLI tool or the web-based management console. See JBoss EAP supported configurations for the most current information about the supported configurations of IBM MQ.
You must restart your system after configuring your IBM MQ resource adapter for the configuration changes to take effect.
Prerequisites
Before you get started, you must verify the version of the IBM MQ resource adapter and understand its configuration properties.
-
The IBM MQ resource adapter is supplied as a Resource Archive (RAR) file called
wmq.jmsra.rar. You can obtain thewmq.jmsra.rarfile from/opt/mqm/java/lib/jca/wmq.jmsra.rar. See JBoss EAP supported configurations for information about the specific versions that are supported for each release of JBoss EAP. You must know the following IBM MQ configuration values. Refer to the IBM MQ product documentation for details about these values.
- MQ_QUEUE_MANAGER: The name of the IBM MQ queue manager
- MQ_HOST_NAME: The host name used to connect to the IBM MQ queue manager
- MQ_CHANNEL_NAME: The server channel used to connect to the IBM MQ queue manager
- MQ_QUEUE_NAME: The name of the destination queue
- MQ_TOPIC_NAME: The name of the destination topic
- MQ_PORT: The port used to connect to the IBM MQ queue manager
- MQ_CLIENT: The transport type
For outbound connections, you must also be familiar with the following configuration value:
- MQ_CONNECTIONFACTORY_NAME: The name of the connection factory instance that will provide the connection to the remote system
Procedure
The following are default configurations provided by IBM and are subject to change. Please refer to IBM MQ documentation for more information.
-
First, deploy the resource adapter manually by copying the
wmq.jmsra.rarfile to theEAP_HOME/standalone/deployments/directory. Next, use the management CLI to add the resource adapter and configure it.
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:add(archive=wmq.jmsra.rar, transaction-support=XATransaction)
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:add(archive=wmq.jmsra.rar, transaction-support=XATransaction)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that the
transaction-supportelement was set toXATransaction. When using transactions, be sure to supply the security domain of the XA recovery datasource, as in the example below./subsystem=resource-adapters/resource-adapter=test/connection-definitions=test:write-attribute(name=recovery-security-domain,value=myDomain)
/subsystem=resource-adapters/resource-adapter=test/connection-definitions=test:write-attribute(name=recovery-security-domain,value=myDomain)Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information about XA Recovery see Configuring XA Recovery in the JBoss EAP Configuration Guide.
For non-transactional deployments, change the value of
transaction-supporttoNoTransaction./subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:add(archive=wmq.jmsra.rar, transaction-support=NoTransaction)
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:add(archive=wmq.jmsra.rar, transaction-support=NoTransaction)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Now that the resource adapter is created, you can add the necessary configuration elements to it.
Add an
admin-objectfor queues and configure its properties./subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao:add(class-name=com.ibm.mq.connector.outbound.MQQueueProxy, jndi-name=java:jboss/MQ_QUEUE_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao/config-properties=baseQueueName:add(value=MQ_QUEUE_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao/config-properties=baseQueueManagerName:add(value=MQ_QUEUE_MANAGER)
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao:add(class-name=com.ibm.mq.connector.outbound.MQQueueProxy, jndi-name=java:jboss/MQ_QUEUE_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao/config-properties=baseQueueName:add(value=MQ_QUEUE_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=queue-ao/config-properties=baseQueueManagerName:add(value=MQ_QUEUE_MANAGER)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add an
admin-objectfor topics and configure its properties./subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao:add(class-name=com.ibm.mq.connector.outbound.MQTopicProxy, jndi-name=java:jboss/MQ_TOPIC_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao/config-properties=baseTopicName:add(value=MQ_TOPIC_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao/config-properties=brokerPubQueueManager:add(value=MQ_QUEUE_MANAGER)
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao:add(class-name=com.ibm.mq.connector.outbound.MQTopicProxy, jndi-name=java:jboss/MQ_TOPIC_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao/config-properties=baseTopicName:add(value=MQ_TOPIC_NAME) /subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar/admin-objects=topic-ao/config-properties=brokerPubQueueManager:add(value=MQ_QUEUE_MANAGER)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a connection definition for a managed connection factory and configure its properties.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you want to change the default provider for the EJB3 messaging system in JBoss EAP from JBoss EAP 7 messaging to IBM MQ, use the management CLI to modify the
ejb3subsystem as follows:/subsystem=ejb3:write-attribute(name=default-resource-adapter-name,value=wmq.jmsra.rar)
/subsystem=ejb3:write-attribute(name=default-resource-adapter-name,value=wmq.jmsra.rar)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the
@ActivationConfigPropertyand@ResourceAdapterannotations in the MDB code as follows:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Be sure to replace the VERSION in the
@ResourceAdaptervalue with the actual version in the name of the RAR.Activate your resource adapter:
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:activate()
/subsystem=resource-adapters/resource-adapter=wmq.jmsra.rar:activate()Copy to Clipboard Copied! Toggle word wrap Toggle overflow
31.6.1. Limitations and Known Issues with the IBM MQ Resource Adapters Copiar o linkLink copiado para a área de transferência!
The following table lists known issues with the IBM MQ resource adapters. A checkmark (✔) in the version column indicates the issue is a problem for that version of the resource adapter.
| JIRA | Description of Issue | IBM MQ 8 | IBM MQ 9 |
|---|---|---|---|
|
The IBM MQ resource adapter returns different String values for the | ✔ | ✔ | |
| The following restrictions apply to message property names for IBM MQ.
See Property name restrictions for IBM MQ, Version 8.0 and Property name restrictions for IBM MQ, Version 9.0 on the IBM Knowledge Center website for the complete list of message property name restrictions for each version of the resource adapter. | ✔ | ✔ | |
|
When specifying the @ActivationConfigProperty(propertyName = "destination", propertyValue = "QUEUE")
| ✔ | ✔ | |
|
If the IBM MQ resource adapter is used to create a connection factory in a Jakarta EE deployment using the | ✔ | ✔ | |
|
The IBM MQ resource adapter is able to read messages from queues and topics even before the connection has started. This means a consumer can consume messages before the connection is started. To avoid hitting this issue, use connection factories created by the remote IBM MQ broker using the | ✔ | ✔ | |
|
Once
In the following code example, the @Inject
@JMSConnectionFactory("jms/CF")
@JMSPasswordCredential(userName="myusername", password="mypassword")
@JMSSessionMode(JMSContext.DUPS_OK_ACKNOWLEDGE)
transient JMSContext context3;
| ✔ | ✔ | |
|
According to the JMS specification, the | ✔ | ✔ | |
|
The | ✔ | ✔ | |
|
The default | ✔ | ✔ | |
|
The IBM MQ resource adapter throws WARN [org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri] (EJB default - 7) IJ000604: Throwable while attempting to get a new connection: null: com.ibm.mq.connector.DetailedResourceException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure.
The following is an example of code that can cause this issue. QueueConnection qc = queueConnectionFactory.createQueueConnection("invalidUserName", "invalidPassword");
| ✔ | ✔ | |
|
Due to an invalid class cast conversion by the resource adapter in the SVR-ERROR: Expected JMSException, received com.ibm.mq.connector.outbound.MQQueueProxy cannot be cast to com.ibm.mq.jms.MQDestination
This is because the JNDI name used in the queue or topic lookup is | ✔ | ✔ | |
|
The | ✔ | ✔ | |
|
If work is done on a | ✔ | ✔ | |
|
If you close a connection and then immediately create a ERROR [io.undertow.request] (default task-1) UT005023: Exception handling request to /jmsServlet-1.0-SNAPSHOT/: com.ibm.msg.client.jms.DetailedJMSRuntimeException: MQJCA0002: An exception occurred in the IBM MQ layer. See the linked exception for details. A call to IBM MQ classes for Java(tm) caused an exception to be thrown.
This issue does not occur when there is a delay in creating the new | ✔ | ✔ | |
| If a stateful session bean tries to send a message to a topic while in a container managed transaction (CMT), the message send fails with the following message. SVR-ERROR: com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to send a message to destination 'MDB_NAME TOPIC_NAME'
The stack trace shows it to be caused by the following exception. com.ibm.mq.MQException: JMSCMQ0001: IBM MQ call failed with compcode '2' ('MQCC_FAILED') reason '2072' ('MQRC_SYNCPOINT_NOT_AVAILABLE')
| ✔ | ✔ | |
|
When you deploy the IBM MQ v9.0.0.4 resource adapter, WARN [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-8) IJ020017: Invalid archive: file:/<path-to-jboss>/jboss-eap-7.3/standalone/tmp/vfs/temp/tempa02bdd5ee254e590/content-135e13d4f38704fc/contents/
The IBM MQ v9.0.0.4 resource adapter was tested as part of the Jakarta Messaging providers tests for JBoss EAP 7.3. You can choose to ignore this warning message or you can disable the archive validation by setting the /subsystem=jca/archive-validation=archive-validation:write-attribute(name=enabled, value=false)
| ✔ | ✔ |
31.7. Deploying a Generic Jakarta Messaging Resource Adapter Copiar o linkLink copiado para a área de transferência!
JBoss EAP can be configured to work with third-party Jakarta Messaging providers; however, not all Jakarta Messaging providers produce a Jakarta Messaging Jakarta Connectors resource adapter for integration with Jakarta application platforms. This procedure covers the steps required to configure the generic Jakarta Messaging resource adapter included in JBoss EAP to connect to a Jakarta Messaging provider. In this procedure, Tibco EMS 8 is used as an example Jakarta Messaging provider. Other Jakarta Messaging providers may require different configuration.
Before using the generic Jakarta Messaging resource adapter, check with the Jakarta Messaging provider to see if they have their own resource adapter that can be used with JBoss EAP. The generic Jakarta Messaging Jakarta Connectors resource adapter should only be used when a Jakarta Messaging provider does not provide its own resource adapter.
Before you can configure a generic resource adapter, you will need to do the following:
- Your Jakarta Messaging provider server must already be configured and ready for use. Any binaries required for the provider’s Jakarta Messaging implementation will be needed.
You will need to know the values of the following Jakarta Messaging provider properties to be able to look up its Jakarta Messaging resources, such as connection factories, queues or topics.
-
java.naming.factory.initial -
java.naming.provider.url -
java.naming.factory.url.pkgs
-
In the example XML used in this procedure, these parameters are written as PROVIDER_FACTORY_INITIAL, PROVIDER_URL, and PROVIDER_CONNECTION_FACTORY respectively. Replace these placeholders with the Jakarta Messaging provider values for your environment.
31.7.1. Configure a Generic Jakarta Messaging Resource Adapter for Use with a Third-party Jakarta Messaging Provider Copiar o linkLink copiado para a área de transferência!
Create and configure the resource adapter module.
Create a JBoss EAP module that contains all the libraries required to connect and communicate with the Jakarta Messaging provider. This module will be named org.jboss.genericjms.provider.
-
Create the following directory structure:
EAP_HOME/modules/org/jboss/genericjms/provider/main Copy the binaries required for the provider’s Jakarta Messaging implementation to
EAP_HOME/modules/org/jboss/genericjms/provider/main.NoteFor Tibco EMS, the binaries required are
tibjms.jarandtibcrypt.jarfrom the Tibco installation’slibdirectory.Create a
module.xmlfile inEAP_HOME/modules/org/jboss/genericjms/provider/mainas below, listing the JAR files from the previous steps as resources:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the module to the
eesubsystem using the following CLI command:/subsystem=ee:list-add(name=global-modules, value={"name" => "org.jboss.genericjms.provider", "slot" =>"main"}/subsystem=ee:list-add(name=global-modules, value={"name" => "org.jboss.genericjms.provider", "slot" =>"main"}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Create the following directory structure:
Create and configure a Java Naming and Directory Interface external context to the Jakarta Messaging provider.
The Jakarta Messaging resources, such as connection factories and destinations, are looked up in the Jakarta Messaging provider. Add an external context in the JBoss EAP instance so that any local lookup for this resource will automatically look up the resource on the remote Jakarta Messaging provider.
NoteIn this procedure,
EAP_HOME/standalone/configuration/standalone-full.xmlis used as the JBoss EAP configuration file.Use the management CLI to create an external Java Naming and Directory Interface context and include its configuration properties. The properties in the example below should be replaced by the correct value to connect to the remote Jakarta Messaging provider. For example, some Jakarta Messaging providers, such as Tibco EMS, do not support the Java Naming and Directory Interface
lookup(Name)method. In these cases, add theorg.jboss.as.naming.lookup.by.stringproperty with a value oftrueto work around this issue. Check the adapter’s documentation for information on required properties and their values./subsystem=naming/binding="java:global/remoteJMS":add(binding-type=external-context,module=org.jboss.genericjms.provider,class=javax.naming.InitialContext,environment=[java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory,java.naming.provider.url=tcp://<hostname>:7222,org.jboss.as.naming.lookup.by.string=true])
/subsystem=naming/binding="java:global/remoteJMS":add(binding-type=external-context,module=org.jboss.genericjms.provider,class=javax.naming.InitialContext,environment=[java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory,java.naming.provider.url=tcp://<hostname>:7222,org.jboss.as.naming.lookup.by.string=true])Copy to Clipboard Copied! Toggle word wrap Toggle overflow With the external context configured properly, any Java Naming and Directory Interface lookup to a resource starting with
java:global/remoteJMS/will be done on the remote Jakarta Messaging provider. As an example, if a message-driven bean performs a Java Naming and Directory Interface lookup forjava:global/remoteJMS/Queue1, the external context will connect to the remote Jakarta Messaging provider and perform a lookup for theQueue1resource.Alternatively, you can make a Java Naming and Directory Interface lookup to the remote server without using an
external-contextwhen looking up the Java Naming and Directory Interface name. To do so, use the CLI to create a new binding that references theexternal-context, as in the example below./subsystem=naming/binding=java\:\/jms\/queue\/myQueue:add(binding-type=lookup, lookup=java:global/remoteJMS/jms/queue/myQueue)
/subsystem=naming/binding=java\:\/jms\/queue\/myQueue:add(binding-type=lookup, lookup=java:global/remoteJMS/jms/queue/myQueue)Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the example above, an application that does a Java Naming and Directory Interface lookup for
java:/jms/queue/myQueuewill locate the queue namedmyQueueon the remote server.Create the generic Jakarta Messaging resource adapter.
Use the management CLI to create the resource adapter
/subsystem=resource-adapters/resource-adapter=generic-ra:add(module=org.jboss.genericjms,transaction-support=XATransaction)
/subsystem=resource-adapters/resource-adapter=generic-ra:add(module=org.jboss.genericjms,transaction-support=XATransaction)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the generic Jakarta Messaging resource adapter.
Use the management CLI to configure the resource adapter’s
connection-definitionand other elements.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the default message-driven bean pool in the
ejb3subsystem to use the generic resource adapter./subsystem=ejb3:write-attribute(name=default-resource-adapter-name, value=generic-ra)
/subsystem=ejb3:write-attribute(name=default-resource-adapter-name, value=generic-ra)Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The generic Jakarta Messaging resource adapter is now configured and ready for use. Below is an example of using the resource adapter when creating a new message-driven bean.
Example: Code Using the Generic Resource Adapter
When using the generic Jakarta Messaging resource adapter, ensure you set the session to be transacted, to avoid a potential NullPointerException error. The error occurs because the generic Jakarta Messaging resource adapter attempts processing of parameters, when the Jakarta EE specification states that they are not to be processed. This is accomplished by doing the following: connection.createSession(true, Session.SESSION_TRANSACTED);
You can also use the pooled connection factory from the resource adapter:
@Resource(lookup = "java:/jms/XAQCF") private ConnectionFactory cf;
@Resource(lookup = "java:/jms/XAQCF")
private ConnectionFactory cf;
It is not possible to inject a resource from an external context directly but it is possible to inject an external context and then perform a lookup. For example, a lookup for a queue deployed in a Tibco EMS broker would be as follows.
@Resource(lookup = "java:global/remoteJMS")
private Context context;
...
Queue queue = (Queue) context.lookup("Queue1")
@Resource(lookup = "java:global/remoteJMS")
private Context context;
...
Queue queue = (Queue) context.lookup("Queue1")
31.8. Using the Resource Annotation Copiar o linkLink copiado para a área de transferência!
Using the @Resource annotation, Jakarta Enterprise Beans can directly inject Jakarta Messaging resources or connection factories. You can specify the following parameters using the @Resource annotations:
-
lookup -
name -
mappedName
To inject a resource, you must specify the Java Naming and Directory Interface (JNDI) name of the resource in one of these parameters.
31.8.1. Injecting Jakarta Messaging Resources Copiar o linkLink copiado para a área de transferência!
Define your queue as shown below:
<jms-queue name="OutQueue" entries="jms/queue/OutQueue java:jboss/exported/jms/queue/OutQueue"/>
<jms-queue name="OutQueue" entries="jms/queue/OutQueue java:jboss/exported/jms/queue/OutQueue"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Inject this queue by specifying its Java Naming and Directory Interface name in the
lookup,name, ormappedNameparameter of the@Resourceannotation. For example:@Resource(lookup = "java:jboss/exported/jms/queue/OutQueue") public Queue myOutQueue;
@Resource(lookup = "java:jboss/exported/jms/queue/OutQueue") public Queue myOutQueue;Copy to Clipboard Copied! Toggle word wrap Toggle overflow
31.8.2. Injecting Connection Factories Copiar o linkLink copiado para a área de transferência!
Define your connection factory as shown below. The example shows a
JmsXApooled connection factory.<pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
<pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Inject the default
activemq-rapooled connection factory as shown below:@Resource(lookup = "java:/JmsXA") private ConnectionFactory cf;
@Resource(lookup = "java:/JmsXA") private ConnectionFactory cf;Copy to Clipboard Copied! Toggle word wrap Toggle overflow
31.8.3. The Limitations and Known Issues for the Generic JMS Resource Adapter Copiar o linkLink copiado para a área de transferência!
The generic JMS resource adapter relies on the JMS API to communicate with JMS servers. Because the JMS API does not provide a programmatic way to create the JMS resources, the following new features that are defined in the Java™ Platform, Enterprise Edition (Java EE) Specification, v7 are not supported.
EE.5.18.4 JMS Connection Factory Resource Definition
This is the ability for an application to define a JMS
ConnectionFactoryresource.EE.5.18.5 JMS Destination Definition
This is the ability for an application to define a JMS
Destinationresource.