-
Bug
-
Resolution: Done
-
Major
-
26.0.0.Final, 26.0.1.Final, 26.1.0.Final
-
None
-
-
-
---
-
---
A message-driven bean that is configured to connect to a queue of a remote ActiveMQ Artemis server requires the permission createDurableQueue.
The following error occurs repeatedly when the server starts:
06:02:02,930 ERROR [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 1) AMQ154003: Unable to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.wildfly.extension.messaging.activemq.ActiveMQResourceAdapter@fb28a229 destination=myQueue destinationType=javax.jms.Queue ack=Auto-acknowledge durable=false user=null maxSession=15): ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229213: User: myUser does not have permission='CREATE_DURABLE_QUEUE' for queue myQueue on address myQueue]
If auto create queue is disable in ActiveMQ Artemis for the address the following info log entry occurs repeatedly:
2022-04-13 09:32:11,955 INFO [org.apache.activemq.artemis.ra.ActiveMQRALogger] (default-threads - 3) [Usr#] AMQ151000: awaiting topic/queue creation java:/jms/queue/myQueue
In Wildfly 25 the permission createDurableQueue is not required for this scenario. This is the expected behaviour.
Extract of the configuration :
<subsystem xmlns="urn:jboss:domain:messaging-activemq:13.0"> <server name="default"> <security elytron-domain="ApplicationDomain"/> <statistics enabled="${wildfly.messaging-activemq.statistics-enabled:${wildfly.statistics-enabled:false}}"/> <security-setting name="#"> <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/> </security-setting> <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/> <remote-connector name="remote-artemis" socket-binding="remote-artemis"/> <in-vm-connector name="in-vm" server-id="0"> <param name="buffer-pooling" value="false"/> </in-vm-connector> <in-vm-acceptor name="in-vm" server-id="0"> <param name="buffer-pooling" value="false"/> </in-vm-acceptor> <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/> <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/> <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/> <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="remote-artemis" client-id="${jms.clientid}" transaction="xa" user="${env.ACTIVEMQ_USER:artemis}" password="${env.ACTIVEMQ_PWD:simetraehcapa}"/> </server> </subsystem> <outbound-socket-binding name="remote-artemis"> <remote-destination host="${env.ACTIVEMQ_HOST:localhost}" port="${env.ACTIVEMQ_PORT:61616}"/> </outbound-socket-binding>
Message-driven bean:
@MessageDriven(activationConfig = { // @ActivationConfigProperty(propertyName = "destination", propertyValue = "myQueue"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")) }) public class MessageListenerBean implements MessageListener { @Inject Logger logger; public MessageListenerBean(){} @Override public void onMessage(Message message) { try { String id = message.getJMSMessageID(); logger.debug("Message received: {}", id); } catch (JMSException e) { e.printStackTrace(); mdc.setRollbackOnly(); } catch (Throwable te) { logger.warn("Failed to receive message", te); } } }
It doesn't matter if the queue name is looked up with jndi or set directly with the destination config property.
- relates to
-
WFLY-13793 Allow for a remote jms queue / topic not to use legacy amq1 prefix
- Closed