Bug 1370364

Summary: Custom DLQ configuration does not work for Topics
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Tyronne Wickramarathne <tywickra>
Component: HornetQAssignee: Yong Hao Gao <hgao>
Status: CLOSED NOTABUG QA Contact: Miroslav Novak <mnovak>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.4.9CC: csuconic, msvehla
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-06 01:51:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
reproducer
none
message-publisher-code none

Description Tyronne Wickramarathne 2016-08-26 04:41:32 UTC
Created attachment 1194203 [details]
reproducer

Description of problem:
It is not possible to configure HornetQ to catch all failed messages through a custom DLQ for a Topic

Version-Release number of selected component (if applicable):
JBoss-EAP-6.4.9

How reproducible:
Always

Steps to Reproduce:
1. Configure a Topic, and a custom DLQ
2. Please assign the custom DLQ in the pre configured Topic
3. Trigger a message delivery failure to make a message moved to the DLQ
4. Observe the server log, the server log would show a WARN message similar to the following :

14:27:48,881 WARN  [org.hornetq.core.server] (Thread-21 (HornetQ-server-HornetQServerImpl::serverUUID=b4259a86-6b44-11e6-a81e-e125fac0c428-2126636943)) HQ222150: Message has exceeded max delivery attempts. No Dead Letter Address configured for queue AAA.BBB so dropping it
Where's the AAA is the specified client id and BBB is the subscription id.


The attached reproducer can be used to recreate this easily :
5. Please copy the attached server configuration file test.xml to standalone/configuration folder in JBoss-EAP-6.4.9
6. Please use the attached eclipse project to deploy two MDBs 
7. Please publish a text message with having the body "NPE" to trigger a NPE to move this message to the configured custom DLQ 
8. The server would complain a missing DLQ for the failed message although there's a pre-configured custom DLQ in place



Additional info:
Further investigations revealed this appears the expected behavior based on how Topics have been implemented internally. The topics are treated as a collection of Queues and the DLQ mechanism is cheking for a DLQ for the "Internal Queue" (topic subscription) than the main Topic.

Comment 2 Clebert Suconic 2016-08-29 17:03:20 UTC
The issue is that the DLA queue wasn't created.


If you set the DLQ to be "DestAddress" and don't create a queue. it won't be sent anywhere and you would see this message.


Doesn't seem a bug.

Comment 3 Tyronne Wickramarathne 2016-08-29 23:35:45 UTC
(In reply to Clebert Suconic from comment #2)
> The issue is that the DLA queue wasn't created.
> 
> 
> If you set the DLQ to be "DestAddress" and don't create a queue. it won't be
> sent anywhere and you would see this message.
> 
> 
> Doesn't seem a bug.

Hi Clebert,

This is not a configuration issue. I have correctly defined a DLQ for the custom dead letter address. Please take a look at the attached server configuration file :


<address-setting match="java.topic.commonEventTopic">
                        <dead-letter-address>jms.queue.MyDLQ</dead-letter-address>
                        <expiry-address>jms.queue.commonEventTopicExpiryQueue</expiry-address>
                        <redelivery-delay>0</redelivery-delay>
                        <max-delivery-attempts>3</max-delivery-attempts>
                        <max-size-bytes>10485760</max-size-bytes>
                        <page-size-bytes>2097152</page-size-bytes>
                        <address-full-policy>PAGE</address-full-policy>
                        <message-counter-history-day-limit>10</message-counter-history-day-limit>
                    </address-setting>

....
....


                    <jms-queue name="MyDLQ">
                        <entry name="java:/jms/queue/MyDLQ"/>
                    </jms-queue>
                    <jms-queue name="commonEventTopicDLQ">
                        <entry name="java:/jms/queue/commonEventTopicDLQ"/>
                    </jms-queue>
                    <jms-queue name="commonEventTopicExpiryQueue">
                        <entry name="java:/jms/queue/commonEventTopicExpiryQueue"/>
                    </jms-queue>
                    ....
                    ....
                    <jms-topic name="commonEventTopic">
                        <entry name="java:/topic/commonEventTopic"/>
                        <entry name="java:jboss/exported/topic/commonEventTopic"/>

Comment 4 Tyronne Wickramarathne 2016-08-30 01:00:48 UTC
Created attachment 1195579 [details]
message-publisher-code

Comment 5 Yong Hao Gao 2016-09-05 09:15:58 UTC
Hi Tyronne

I tried the latest HornetQ and it works. Here I spotted a possible misconfiguration:

<address-setting match="java.topic.commonEventTopic">

As all JMS topics are prefixed jms.topic, so the match string should be

jms.topic.commonEventTopic

Using java.topic you won't be able to find the DLQ match any of the JMS topics.

Can you verify?

Thanks,
Howard

Comment 6 Tyronne Wickramarathne 2016-09-06 01:51:45 UTC
I could confirm this is a configuration issue, not a bug.