Bug 489005 - Durable subscriptions don't work if clientid has underscores in it
Durable subscriptions don't work if clientid has underscores in it
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java (Show other bugs)
1.0
All Linux
high Severity medium
: 1.1.1
: ---
Assigned To: Rajith Attapattu
Frantisek Reznicek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-06 12:35 EST by Gordon Sim
Modified: 2015-11-15 19:07 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-21 12:18:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gordon Sim 2009-03-06 12:35:12 EST
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 14:45:32 EDT
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 09:39:01 EDT
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 12:18:20 EDT
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

Note You need to log in before you can comment on or make changes to this bug.