Bug 489005

Summary: Durable subscriptions don't work if clientid has underscores in it
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-javaAssignee: Rajith Attapattu <rattapat+nobody>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: medium Docs Contact:
Priority: high    
Version: 1.0CC: esammons, iboverma
Target Milestone: 1.1.1   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-21 16:18:20 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gordon Sim 2009-03-06 17:35:12 UTC
If the clientid specified in a connection URL has underscores in it, durable queues get created using the hostname + a random number and thus change on successive runs meaning that saved messages cannot be retrieved.

Suspect this is simply an error in the URL parsing whereby it thinks the client id is not specified if it has underscores in it.

Comment 1 Rajith Attapattu 2009-03-09 18:45:32 UTC
A fix for this is checked in to Qpid trunk r751061.
The issue is can be tracked by QPID-1720.

To verify the fix you could do the following.

1. Start a broker with the store module and trace enabled(-t)

2. Create a connection using the following URL amqp://guest:guest@client_id/test?brokerlist='tcp://localhost:5672'

3. create a session and then create a durable topic subscriber using session.createDurableSubscriber()

4. Check the broker logs and you should be able to see a queueDeclare with the queue_name as client_id + <subscription name>

-----------------------------------------------------------------------------
Sample code,

Context ctx = new InitialContext();
            ConnectionFactory confac = (ConnectionFactory)ctx.lookup("DURABLE_SUB_CONNECTION_FACTORY"); 
            Connection con = confac.createConnection();
            Session ssn = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
            
            Topic topic = (Topic)ctx.lookup("MY_TOPIC");
            TopicSubscriber subscriber = ssn.createDurableSubscriber(topic, "MySubscription");
------------------------------------------------------------------------------

In the broker you should see the following
=======================================================
2009-mar-09 14:27:06 trace RECV [127.0.0.1:54196]: Frame[BEbe; channel=0; {QueueDeclareBody: queue=client_id:MySubscription; alternate-exchange=; durable=1; arguments={}; }]
=======================================================

Comment 3 Frantisek Reznicek 2009-04-01 13:39:01 UTC
The issue has been fixed, validated on RHEL 4.7 / 5.2 / 5.3 i386 / x86_64 on packages:
[root@intel-d3x1311-01 java]# rpm -qa | egrep '(qpid|rhm)' | sort -u
python-qpid-0.5.752581-1.el5
qpidc-0.5.752581-3.el5
qpidc-devel-0.5.752581-3.el5
qpidc-perftest-0.5.752581-3.el5
qpidc-rdma-0.5.752581-3.el5
qpidc-ssl-0.5.752581-3.el5
qpidd-0.5.752581-3.el5
qpidd-acl-0.5.752581-3.el5
qpidd-cluster-0.5.752581-3.el5
qpidd-devel-0.5.752581-3.el5
qpidd-rdma-0.5.752581-3.el5
qpidd-ssl-0.5.752581-3.el5
qpidd-xml-0.5.752581-3.el5
qpid-java-client-0.5.751061-1.el5
qpid-java-common-0.5.751061-1.el5
rhm-0.5.3206-1.el5
rhm-docs-0.5.756148-1.el5

->VERIFIED

Comment 5 errata-xmlrpc 2009-04-21 16:18:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0434.html