Skip to content

Cannot send messages to / receive messages from JMS destinations with special names for native Artemis #36164

@joshdcu

Description

@joshdcu

Description

Spring Boot: v3.5.9
Spring Framework: v6.2.15

  • JMS doesn't restrict the values for the destination names. Neither does Artemis as a JMS broker.

  • Attempting to send messages to / receive messages from a JMS destination with a control character (ex: mailbox\r\n) fails when using Artemis in the native mode:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.5.9)

2026-01-16T20:35:14.045+05:30  INFO 40104 --- [demo] [           main] com.example.demo.DemoApplication         : Starting DemoApplication v0.0.1-SNAPSHOT using Java 21.0.9 with PID 40104 (C:\Users\USERNAME\Desktop\demo\demo\target\demo-0.0.1-SNAPSHOT.jar started by USERNAME in C:\Users\USERNAME\Desktop\demo\demo)  
2026-01-16T20:35:14.049+05:30  INFO 40104 --- [demo] [           main] com.example.demo.DemoApplication         : The following 1 profile is active: "repro"    
2026-01-16T20:35:15.298+05:30  INFO 40104 --- [demo] [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.679 seconds (process running for 2.222)
=============================
Sending an email message.
=============================
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:106)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64)
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:40)
Caused by: org.springframework.jms.JmsSecurityException: AMQ229032: User: artemis does not have permission='CREATE_ADDRESS' on address mailbox

        at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:284)
        at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:198)
        at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:526)
        at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:603)
        at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:680)
        at org.springframework.jms.core.JmsTemplate.convertAndSend(JmsTemplate.java:669)
        at com.example.demo.DemoApplication.main(DemoApplication.java:50)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 4 more
Caused by: jakarta.jms.JMSSecurityException: AMQ229032: User: artemis does not have permission='CREATE_ADDRESS' on address mailbox

        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:580)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:464)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:456)
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createAddress(ActiveMQSessionContext.java:758)
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createAddress(ClientSessionImpl.java:313)
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createAddress(ClientSessionImpl.java:321)
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.checkDestination(ActiveMQSession.java:468)
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createProducer(ActiveMQSession.java:447)
        at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.getCachedProducer(CachingConnectionFactory.java:438)      
        at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:364)
        at jdk.proxy2/jdk.proxy2.$Proxy55.createProducer(Unknown Source)
        at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:1135)
        at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:1116)
        at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:621)
        at org.springframework.jms.core.JmsTemplate.lambda$send$3(JmsTemplate.java:605)
        at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:523)
        ... 9 more
Caused by: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229032: User: artemis does not have permission='CREATE_ADDRESS' on address mailbox 
]
        ... 25 more
2026-01-16T20:35:16.404+05:30  INFO 40104 --- [demo] [ntContainer#0-1] o.s.j.c.CachingConnectionFactory         : Encountered a JMSException - resetting the underlying JMS Connection

jakarta.jms.JMSSecurityException: AMQ229213: User: artemis does not have permission='CREATE_DURABLE_QUEUE' for queue mailbox
 on address mailbox

        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:580) ~[artemis-core-client-2.40.0.jar!/:2.40.0]        
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:464) ~[artemis-core-client-2.40.0.jar!/:2.40.0]        
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:456) ~[artemis-core-client-2.40.0.jar!/:2.40.0]        
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createQueue(ActiveMQSessionContext.java:856) ~[artemis-core-client-2.40.0.jar!/:2.40.0]
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.internalCreateQueue(ClientSessionImpl.java:1953) ~[artemis-core-client-2.40.0.jar!/:2.40.0]
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createQueue(ClientSessionImpl.java:326) ~[artemis-core-client-2.40.0.jar!/:2.40.0]    
        at org.apache.activemq.artemis.utils.AutoCreateUtil.autoCreateQueue(AutoCreateUtil.java:57) ~[artemis-core-client-2.40.0.jar!/:2.40.0]
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:917) ~[artemis-jakarta-client-2.40.0.jar!/:2.40.0]        
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:563) ~[artemis-jakarta-client-2.40.0.jar!/:2.40.0]        
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createConsumer(ActiveMQSession.java:539) ~[artemis-jakarta-client-2.40.0.jar!/:2.40.0]        
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
        at org.springframework.jms.connection.CachingConnectionFactory$CachedSessionInvocationHandler.invoke(CachingConnectionFactory.java:422) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at jdk.proxy2/jdk.proxy2.$Proxy55.createConsumer(Unknown Source) ~[na:na]
        at org.springframework.jms.listener.AbstractMessageListenerContainer.createConsumer(AbstractMessageListenerContainer.java:960) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.createListenerConsumer(AbstractPollingMessageListenerContainer.java:225) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:1462) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1426) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1417) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1294) ~[spring-jms-6.2.15.jar!/:6.2.15]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]
Caused by: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229213: User: artemis does not have permission='CREATE_DURABLE_QUEUE' for queue mailbox
 on address mailbox
]
        ... 21 common frames omitted

2026-01-16T20:35:16.427+05:30  WARN 40104 --- [demo] [ntContainer#0-1] o.s.j.l.DefaultMessageListenerContainer  : Setup of JMS message listener invoker failed for destination 'mailbox
' - trying to recover. Cause: AMQ229213: User: artemis does not have permission='CREATE_DURABLE_QUEUE' for queue mailbox
 on address mailbox

  • Interestingly, these same operations are successful when Artemis is used in the embedded mode:
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.5.9)

2026-01-16T19:28:03.811+05:30  INFO 42852 --- [demo] [           main] com.example.demo.DemoApplication         : Starting DemoApplication v0.0.1-SNAPSHOT using Java 21.0.9 with PID 42852 (C:\Users\USERNAME\Desktop\demo\demo\target\demo-0.0.1-SNAPSHOT.jar started by USERNAME in C:\Users\USERNAME\Desktop\demo\demo)
2026-01-16T19:28:03.811+05:30  INFO 42852 --- [demo] [           main] com.example.demo.DemoApplication         : No active profile set, falling back to 1 default profile: "default"
2026-01-16T19:28:04.684+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221000: Primary message broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=C:\Users\USERNAME\AppData\Local\Temp\artemis-data/journal,bindingsDirectory=data/bindings,largeMessagesDirectory=data/largemessages,pagingDirectory=data/paging)
2026-01-16T19:28:04.684+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221045: libaio is not available, switching the configuration into NIO
2026-01-16T19:28:04.700+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 4223664128
2026-01-16T19:28:04.717+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE
2026-01-16T19:28:04.739+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601138: User anonymous@unknown is getting notification info on target resource: null
2026-01-16T19:28:04.741+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.ActiveMQServerControlImpl@7b306b9f
2026-01-16T19:28:04.741+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601138: User anonymous@unknown is getting notification info on target resource: ActiveMQServerImpl::name=localhost
2026-01-16T19:28:04.749+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ224092: Despite disabled persistence, page files will be persisted.
2026-01-16T19:28:04.765+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221080: Deploying address DLQ supporting [ANYCAST]
2026-01-16T19:28:04.768+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.AddressControlImpl@17273273
2026-01-16T19:28:04.770+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221003: Deploying ANYCAST queue DLQ on address DLQ
2026-01-16T19:28:04.938+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.QueueControlImpl@58b91d57
2026-01-16T19:28:04.939+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST]
2026-01-16T19:28:04.939+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.AddressControlImpl@61a91c9b
2026-01-16T19:28:04.939+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue
2026-01-16T19:28:04.939+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.QueueControlImpl@17092fff
2026-01-16T19:28:04.939+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.AddressControlImpl@4667c4c1
2026-01-16T19:28:04.976+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.base           : AMQ601019: User anonymous@unknown is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.AcceptorControlImpl@1ee47d9e
2026-01-16T19:28:04.990+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221007: Server is now active
2026-01-16T19:28:04.991+05:30  INFO 42852 --- [demo] [           main] o.apache.activemq.artemis.core.server    : AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.40.0 [localhost, nodeID=60f56bc8-f2e3-11f0-8bdc-025041000001]
2026-01-16T19:28:05.107+05:30  INFO 42852 --- [demo] [           main] org.apache.activemq.audit.resource       : AMQ601767: CORE connection 61381a1d-f2e3-11f0-8bdc-025041000001 for user unknown@invm:0 created
2026-01-16T19:28:05.157+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601267: User anonymous@invm:0 is creating a core session on target resource ActiveMQServerImpl::name=localhost with parameters: [61400960-f2e3-11f0-8bdc-025041000001, null, ****, 102400, RemotingConnectionImpl [ID=61381a1d-f2e3-11f0-8bdc-025041000001, clientID=null, nodeID=60f56bc8-f2e3-11f0-8bdc-025041000001, transportConnection=InVMConnection [serverID=0, id=61381a1d-f2e3-11f0-8bdc-025041000001]], false, false, false, false, null, org.apache.activemq.artemis.core.protocol.core.impl.CoreSessionCallback@395753be, true, {}]
2026-01-16T19:28:05.189+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601267: User anonymous@invm:0 is creating a core session on target resource ActiveMQServerImpl::name=localhost with parameters: [614364c1-f2e3-11f0-8bdc-025041000001, null, ****, 102400, RemotingConnectionImpl [ID=61381a1d-f2e3-11f0-8bdc-025041000001, clientID=null, nodeID=60f56bc8-f2e3-11f0-8bdc-025041000001, transportConnection=InVMConnection [serverID=0, id=61381a1d-f2e3-11f0-8bdc-025041000001]], false, false, false, false, null, org.apache.activemq.artemis.core.protocol.core.impl.CoreSessionCallback@14476ba8, true, {}]
2026-01-16T19:28:05.190+05:30  INFO 42852 --- [demo] [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.786 seconds (process running for 2.246)
=============================
Sending an email message.
=============================
2026-01-16T19:28:05.202+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601267: User anonymous@invm:0 is creating a core session on target resource ActiveMQServerImpl::name=localhost with parameters: [6146c022-f2e3-11f0-8bdc-025041000001, null, ****, 102400, RemotingConnectionImpl [ID=61381a1d-f2e3-11f0-8bdc-025041000001, clientID=null, nodeID=60f56bc8-f2e3-11f0-8bdc-025041000001, transportConnection=InVMConnection [serverID=0, id=61381a1d-f2e3-11f0-8bdc-025041000001]], true, true, false, false, null, org.apache.activemq.artemis.core.protocol.core.impl.CoreSessionCallback@45456f15, true, {}]
2026-01-16T19:28:05.213+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601262: User anonymous@invm:0 is creating address on target resource: 6146c022-f2e3-11f0-8bdc-025041000001 with parameters: [mailbox
, [ANYCAST], true]
2026-01-16T19:28:05.215+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601019: User anonymous@invm:0 is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.AddressControlImpl@5ba83d5a
2026-01-16T19:28:05.227+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.resource       : AMQ601065: User anonymous@invm:0 is creating a queue on target resource: ServerSessionImpl() with parameters: [QueueConfiguration [id=null, name=mailbox
, address=mailbox
, routingType=ANYCAST, filterString=null, durable=true, user=null, maxConsumers=-1, exclusive=null, groupRebalance=null, groupRebalancePauseDispatch=null, groupBuckets=null, groupFirstKey=null, lastValue=null, lastValueKey=null, nonDestructive=null, purgeOnNoConsumers=false, enabled=null, consumersBeforeDispatch=null, delayBeforeDispatch=null, consumerPriority=null, autoDelete=null, autoDeleteDelay=null, autoDeleteMessageCount=null, ringSize=null, configurationManaged=null, temporary=false, autoCreateAddress=null, internal=null, transient=null, autoCreated=true, fqqn=null]]
2026-01-16T19:28:05.227+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.resource       : AMQ601065: User anonymous@invm:0 is creating a queue on target resource: ServerSessionImpl() with parameters: [QueueConfiguration [id=null, name=mailbox
, address=mailbox
, routingType=ANYCAST, filterString=null, durable=true, user=null, maxConsumers=-1, exclusive=null, groupRebalance=null, groupRebalancePauseDispatch=null, groupBuckets=null, groupFirstKey=null, lastValue=null, lastValueKey=null, nonDestructive=null, purgeOnNoConsumers=false, enabled=null, consumersBeforeDispatch=null, delayBeforeDispatch=null, consumerPriority=null, autoDelete=null, autoDeleteDelay=null, autoDeleteMessageCount=null, ringSize=null, configurationManaged=null, temporary=false, autoCreateAddress=null, internal=null, transient=null, autoCreated=true, fqqn=null]]
2026-01-16T19:28:05.227+05:30  WARN 42852 --- [demo] [name=localhost)] o.apache.activemq.artemis.core.server    : AMQ222165: No Dead Letter Address configured for queue mailbox
 in AddressSettings
2026-01-16T19:28:05.231+05:30  WARN 42852 --- [demo] [name=localhost)] o.apache.activemq.artemis.core.server    : AMQ222166: No Expiry Address configured for queue mailbox
 in AddressSettings
2026-01-16T19:28:05.231+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601019: User anonymous@invm:0 is getting mbean info on target resource: org.apache.activemq.artemis.core.management.impl.QueueControlImpl@1f547759
2026-01-16T19:28:05.232+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.base           : AMQ601265: User anonymous@invm:0 is creating a core consumer on target resource ServerSessionImpl() with parameters: [0, mailbox
, null, 0, false, true, null]
2026-01-16T19:28:05.290+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.message        : AMQ601500: User anonymous@invm:0 sent a message CoreMessage[messageID=19, durable=true, userID=6150d245-f2e3-11f0-8bdc-025041000001, priority=4, timestamp=Fri Jan 16 19:28:05 IST 2026, expiration=0, durable=true, address=mailbox
, size=270, properties=TypedProperties[__AMQ_CID=6140095f-f2e3-11f0-8bdc-025041000001, _AMQ_ROUTING_TYPE=1]]@2067593046, context: RoutingContextImpl(Address=mailbox
, routingType=ANYCAST, PreviousAddress=mailbox
 previousRoute:ANYCAST, reusable=true, version=-2147483645)
..................................................
***** durable queues mailbox
:
- queueID=14 address:mailbox
 name:mailbox
 filter:null
***** non durable for mailbox
:
..................................................
, transaction: null
2026-01-16T19:28:05.290+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.message        : AMQ601501: User anonymous@invm:0 is consuming a message from mailbox
: Reference[19]:RELIABLE:CoreMessage[messageID=19, durable=true, userID=6150d245-f2e3-11f0-8bdc-025041000001, priority=4, timestamp=Fri Jan 16 19:28:05 IST 2026, expiration=0, durable=true, address=mailbox
, size=270, properties=TypedProperties[__AMQ_CID=6140095f-f2e3-11f0-8bdc-025041000001, _AMQ_ROUTING_TYPE=1]]@2067593046
=============================
Received <Hello from the other side>
=============================
2026-01-16T19:28:05.326+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.message        : AMQ601759: User anonymous@invm:0 added acknowledgement of a message from mailbox
: CoreMessage[messageID=19, durable=true, userID=6150d245-f2e3-11f0-8bdc-025041000001, priority=4, timestamp=Fri Jan 16 19:28:05 IST 2026, expiration=0, durable=true, address=mailbox
, size=270, properties=TypedProperties[__AMQ_CID=6140095f-f2e3-11f0-8bdc-025041000001, _AMQ_ROUTING_TYPE=1]]@2067593046 to transaction: TransactionImpl [xid=null, txID=9, xid=null, state=ACTIVE, createTime=1768571885190(Fri Jan 16 19:28:05 IST 2026), timeoutSeconds=300, nr operations = 1]@1ea5d0b5
2026-01-16T19:28:05.326+05:30  INFO 42852 --- [demo] [name=localhost)] org.apache.activemq.audit.message        : AMQ601502: User anonymous@invm:0 acknowledged message from mailbox
: CoreMessage[messageID=19, durable=true, userID=6150d245-f2e3-11f0-8bdc-025041000001, priority=4, timestamp=Fri Jan 16 19:28:05 IST 2026, expiration=0, durable=true, address=mailbox
, size=270, properties=TypedProperties[__AMQ_CID=6140095f-f2e3-11f0-8bdc-025041000001, _AMQ_ROUTING_TYPE=1]]@2067593046, transaction: TransactionImpl [xid=null, txID=9, xid=null, state=COMMITTED, createTime=1768571885190(Fri Jan 16 19:28:05 IST 2026), timeoutSeconds=300, nr operations = 0]@1ea5d0b5
2026-01-16T19:28:09.380+05:30  INFO 42852 --- [demo] [ionShutdownHook] org.apache.activemq.audit.resource       : AMQ601768: CORE connection 61381a1d-f2e3-11f0-8bdc-025041000001 for user anonymous@invm:0 destroyed
2026-01-16T19:28:09.380+05:30  INFO 42852 --- [demo] [ionShutdownHook] o.apache.activemq.artemis.core.server    : AMQ221002: Apache ActiveMQ Artemis Message Broker version 2.40.0 [60f56bc8-f2e3-11f0-8bdc-025041000001] stopped, uptime 4.712 seconds

Reproduction

The reproduction is based on the JMS messaging guide on the Spring Boot documentation website

  1. Ensure Java 21, a recent version of Maven, and Docker/Podman are installed on your machine.
  2. Download the project ZIP (demo.zip) to your machine and extract it.
  3. Build the app by running mvn clean package at the root of the project.
  4. Launch Artemis as a container (version 2.40.0 is used to match the versions of the Artemis client and embedded Artemis server used by Spring 6.2.15 / Spring Boot 3.5.9):
podman run -d --name artemis -p 61616:61616 docker.io/apache/activemq-artemis:2.40.0-alpine

In both scenarios below, the JmsTemplate and JmsListener are configured to send a message to and receive a message from the mailbox\r\n queue.

Artemis in embedded mode

Run the app and see that the message is sent and received successfully:

java -jar target/demo-0.0.1-SNAPSHOT.jar

(The sample output is already provided above)

Artemis in native mode

Run the app with the repro Spring profile activated and observe failures in both the JmsTemplate and JmsListener:

java -Dspring.profiles.active=repro -jar target/demo-0.0.1-SNAPSHOT.jar

(The sample output is already provided above)

Other Notes

The failure due to permissions appears to be a red herring because the artemis user can successfully create queues without the control characters, and the message is sent and received successfully:

java -Dapp.destination.name=mailbox -Dspring.profiles.active=repro -jar target/demo-0.0.1-SNAPSHOT.jar
  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.5.9)

2026-01-16T21:00:26.684+05:30  INFO 39644 --- [demo] [           main] com.example.demo.DemoApplication         : Starting DemoApplication v0.0.1-SNAPSHOT using Java 21.0.9 with PID 39644 (C:\Users\212811148\Desktop\demo\demo\target\demo-0.0.1-SNAPSHOT.jar started by 212811148 in C:\Users\212811148\Desktop\demo\demo)  
2026-01-16T21:00:26.695+05:30  INFO 39644 --- [demo] [           main] com.example.demo.DemoApplication         : The following 1 profile is active: "repro"    
2026-01-16T21:00:27.946+05:30  INFO 39644 --- [demo] [           main] com.example.demo.DemoApplication         : Started DemoApplication in 1.678 seconds (process running for 2.19)
=============================
Sending an email message.
=============================
=============================
Received 
=============================

Using the Artemis CLI packaged in the native Artemis broker, I am able to create a queue and address with control characters:

> podman run -d --name artemis -p 61616:61616 docker.io/apache/activemq-artemis:2.40.0-alpine
> podman exec -it artemis sh
# create the queue and address with control characters
/var/lib/artemis-instance $ bin/artemis queue create --anycast --auto-create-address --durable --preserve-on-no-consumers --address $'mailbox\r\n' --name $'mailbox\r\n' --user artemis --password artemis
Connection brokerURL = tcp://localhost:61616
Queue [name=mailbox
, address=mailbox
, routingType=ANYCAST, durable=true, purgeOnNoConsumers=false, autoCreateAddress=false, exclusive=false, lastValue=false, lastValueKey=null, nonDestructive=false, consumersBeforeDispatch=0, delayBeforeDispatch=-1, autoCreateAddress=false] created successfully.
# stat the queue to see the control characters
/var/lib/artemis-instance $ bin/artemis queue stat --user artemis --password artemis --verbose --json --queueName $'mailbox\r\n'
Executing org.apache.activemq.artemis.cli.commands.queue.StatQueue queue stat --user artemis --password artemis --verbose --json --queueName mailbox

Home::/opt/activemq-artemis, Instance::/var/lib/artemis-instance
filter is '{"field":"NAME","value":"mailbox\r\n","operation":"CONTAINS"}'
maxRows='50'
{"data":[
   {"id":"874","name":"mailbox\r\n","address":"mailbox\r\n","filter":"","durable":"true","paused":"false","temporary":"false","purgeOnNoConsumers":"false","consumerCount":"0","maxConsumers":"-1","autoCreated":"false","user":"","routingType":"ANYCAST","messagesAdded":"0","messageCount":"0","messagesAcked":"0","messagesExpired":"0","deliveringCount":"0","messagesKilled":"0","directDeliver":"false","exclusive":"false","lastValue":"false","lastValueKey":"","scheduledCount":"0","groupRebalance":"false","groupRebalancePauseDispatch":"false","groupBuckets":"-1","groupFirstKey":"","enabled":"true","ringSize":"-1","consumersBeforeDispatch":"0","delayBeforeDispatch":"-1","autoDelete":"false","internalQueue":"false"}
],"count":1}

However, I get the same exception as I did with Spring when I try to send a message to this queue:

/var/lib/artemis-instance $ bin/artemis producer --destination $'queue://mailbox\r\n' --user artemis --password artemis --message "Hello from the other side"
--message-count 1
Connection brokerURL = tcp://localhost:61616
javax.jms.JMSSecurityException: AMQ229032: User: artemis does not have permission='CREATE_ADDRESS' on address mailbox

        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:580)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:464)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:456)
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.createAddress(ActiveMQSessionContext.java:758)
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createAddress(ClientSessionImpl.java:313)
        at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.createAddress(ClientSessionImpl.java:321)
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.checkDestination(ActiveMQSession.java:468)
        at org.apache.activemq.artemis.jms.client.ActiveMQSession.createProducer(ActiveMQSession.java:447)
        at org.apache.activemq.artemis.cli.commands.messages.ProducerThread.run(ProducerThread.java:81)
Caused by: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229032: User: artemis does not have permission='CREATE_ADDRESS' on address mailbox
]
        ... 9 more

or a similar exception if the queue was already created using the Artemis CLI:

/var/lib/artemis-instance $ bin/artemis producer --destination $'queue://mailbox\r\n' --user artemis --password artemis --message "Hello from the other side"
--message-count 1
Connection brokerURL = tcp://localhost:61616
Producer ActiveMQQueue[mailbox
], thread=0 Started to calculate elapsed time ...

javax.jms.JMSSecurityException: AMQ229032: User: artemis does not have permission='SEND' on address mailbox

        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:580)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:464)
        at org.apache.activemq.artemis.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:456)
        at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.sendFullMessage(ActiveMQSessionContext.java:585)
        at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.sendRegularMessage(ClientProducerImpl.java:300)
        at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.doSend(ClientProducerImpl.java:272)
        at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:142)
        at org.apache.activemq.artemis.core.client.impl.ClientProducerImpl.send(ClientProducerImpl.java:124)
        at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.doSendx(ActiveMQMessageProducer.java:483)
        at org.apache.activemq.artemis.jms.client.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:194)
        at org.apache.activemq.artemis.cli.commands.messages.ProducerThread.sendMessage(ProducerThread.java:133)
        at org.apache.activemq.artemis.cli.commands.messages.ProducerThread.run(ProducerThread.java:99)
Caused by: ActiveMQSecurityException[errorType=SECURITY_EXCEPTION message=AMQ229032: User: artemis does not have permission='SEND' on address mailbox
]
        ... 12 more

Metadata

Metadata

Assignees

Labels

in: messagingIssues in messaging modules (jms, messaging)status: feedback-providedFeedback has been providedstatus: invalidAn issue that we don't feel is valid

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions