[
https://issues.jboss.org/browse/WFLY-9305?page=com.atlassian.jira.plugin....
]
Jeff Mesnil commented on WFLY-9305:
-----------------------------------
There is no issue with binding the JMS destination in the app namespace.
The issue is that when the ActiveMQ RA is activated, it attempts to lookup the destination
but its JNDI context is not aware of the app namespace.
I don't understand the full issue yet but it seems to me that the underlying cause is
that work performed by the resource adapter when a deployment is installed is not using
the correct JNDI context selector . It is using the *default* JNDI context selector (that
is set in org.jboss.as.naming.service.DefaultNamespaceContextSelectorService#start)
instead of the one relevant to deployment
(org.jboss.as.ee.naming.InjectedEENamespaceContextSelector)
This selector can be pushed/popped appropriately by deployments that use the
JavaNamespaceSetup action (attached to Attachments.JAVA_NAMESPACE_SETUP_ACTION).
However it is not clear to me who and where should setup this JavaNamespaceSetup when a
MDB is deployed.
When the MDB is activated
(org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent#activate), it calls
endpoint.activate() that calls Artemis'
org.apache.activemq.artemis.ra.inflow.ActiveMQActivation#start method. This method will
then schedule JCA work to run its SetupActivation Work that is responsible to look up the
resources in JNDI.
Ultimately, the thread executing this code is owned by IronJacamar and it is on this
thread that we should push/pop the namespaceContextSelector.
the connector subsystem defines a WildflyWorkWrapper that would be the correct place to
put the push/pop calls...
However I have no idea how to pass the correct InjectedEENamespaceContextSelector to this
class.
TL;DR when a MDB is activated (in
org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent#activate), I can get the
correct namespaceContextSelector but I have no idea how to pass it to the IJ WorkManager
so that Artemis' SetupActivation work is run with it.
[~maeste] Do you have an idea about this?
ActiveMQ Resource Adapter can not lookup destination in app
namespace
---------------------------------------------------------------------
Key: WFLY-9305
URL:
https://issues.jboss.org/browse/WFLY-9305
Project: WildFly
Issue Type: Bug
Components: JMS, Naming
Reporter: Jeff Mesnil
Assignee: Jeff Mesnil
When using JMSDefinition defining a non-global JNDI name, Queue/Topic isn't created
and MDB listening to those won't read incoming messages.
Example using non global JNDI (this doesn't work (x) ):
{code:java}
@JMSDestinationDefinition(
name = "java:app/jms/queue",
interfaceName = "javax.jms.Queue"
)
{code}
Example using global JNDI (this works (/)):
{code:java}
@JMSDestinationDefinition(
name = "java:/app/jms/queue",
interfaceName = "javax.jms.Queue"
)
{code}
When using the non-global JNDI and deploying, a message like this can be seen:
{noformat}
13:20:15,542 INFO [org.apache.activemq.artemis.ra] (default-threads - 2) AMQ151001:
Attempting to reconnect
org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.apache.activemq.artemis.ra.ActiveMQResourceAdapter@78712571
destination=java:app/jms/queue destinationType=javax.jms.Queue ack=Auto-acknowledge
durable=false clientID=null user=null maxSession=15)
{noformat}
and creating an MDB to listen sent messages won't receive any.
Attached a reproducer WAR Maven project. Just deploy, access index.xhtml, click on
"Test" button and check logs.
--
This message was sent by Atlassian JIRA
(v7.2.3#72005)