#RedHat #JBoss and #Artemis dead-letter queue issue

By | July 14, 2019

After migrating from ActiveMq to the embeded JBoss EAP Artemis messaging server ( see link ) I was getting the following error related to the dead message queue (the default queue where messages that failed to be processed end up).

10:21:04,620 WARN [org.wildfly.iiop.openjdk] (ServerService Thread Pool — 7) WFLYIIOP0111: SSL has not been configured but ssl-port property has been specified – the connection will use clear-text protocol

WFLYIIOP0111

Warns the user if a address-setting has defined an expiry-address or a dead-letter-address with no queue bound for them as this will result in unintended message loss.

WildFly default full configuration specifies an expiry address (jms.queue.ExpiryQueue) and dead-letter-addres (jms.queue.DLQ) for the # address settings (i.e. matching all addresses).
To have a consistent configuration, we must also define 2 queues that will be bound to these settings.

In the standalone.xml configuration file we should add in the messaging subsystem something like the following:

...
<subsystem xmlns="urn:jboss:domain:messaging-activemq:4.0">
        <server name="default">
            <security enabled="false"/>
            <management address="localhost" jmx-enabled="true" jmx-domain="org.apache.activemq.artemis"/>
            <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.mq.sys.dmq" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
            <http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/>
            <http-connector name="http-connector-throughput" socket-binding="http" endpoint="http-acceptor-throughput">
                <param name="batch-delay" value="50"/>
            </http-connector>
            <in-vm-connector name="in-vm" server-id="0">
                <param name="buffer-pooling" value="false"/>
            </in-vm-connector>
            <http-acceptor name="http-acceptor" http-listener="default"/>
            <http-acceptor name="http-acceptor-throughput" http-listener="default">
                <param name="batch-delay" value="50"/>
                <param name="direct-deliver" value="false"/>
            </http-acceptor>
            <remote-acceptor name="internal-messaging-acceptor" socket-binding="internal-messaging"/>
            <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="mq.sys.dmq" entries="queue/mq.sys.dmq java:jboss/exported/jms/queue/mq.sys.dmq"/>
           ...        
            <jms-queue name="dummy" entries="queue/dummy java:jboss/exported/jms/queue/dummy"/>
            <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
            <connection-factory name="RemoteConnectionFactory" entries="java:jboss/exported/jms/RemoteConnectionFactory" connectors="http-connector"/>
            <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
        </server>
    </subsystem>
...

Note the syntax used to correctly define the entries for the “ExpiryQueue”, “mq.sys.dmq” and “dummy” queues.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.