Bug 616457 - Allow session.createQueue and session.createTopic methods to accept an address string
Summary: Allow session.createQueue and session.createTopic methods to accept an addres...
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-java   
(Show other bugs)
Version: Development
Hardware: All
OS: Linux
high
high
Target Milestone: 1.3
: ---
Assignee: Rajith Attapattu
QA Contact: Jeff Needle
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-07-20 14:07 UTC by Rajith Attapattu
Modified: 2010-10-20 13:53 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-20 11:30:15 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Rajith Attapattu 2010-07-20 14:07:05 UTC
Description of problem:

The session.createQueue and session.createTopic methods allows applications to create destination dynamically.
The intended usage here is to pass in the queue or topic name.
However It would be nice if this could be used as an extension point to allow an application to create destinations by passing in an address string.
This allows applications to create more complex destinations at runtime, while still using standard JMS methods without having to resort to any Qpid specific code.

Comment 1 Rajith Attapattu 2010-07-29 13:19:35 UTC
This is tracked in upstream via QPID-2736.

Git commit URL.
http://mrg1.lab.bos.redhat.com/cgit/qpid.git/commit/?id=aaba759634864e09845aeaff93fbe97458acfc36

Comment 2 Rajith Attapattu 2010-07-29 13:34:40 UTC
Steps to test
================

1. Pass in different address strings to session.createQueue and session.createTopic methods

Ex

   Session ssn = con.createSession(false, Session.AUTO_ACKNOWLEDGE);
   Destination  ssn.createQueue(<your-address-string>);
   // create producer and consumer and test message delivery is as expected.


2. You could simply pass in a Queue or Topic name or a complete address string.
   Ex.

   Destination queue = ssn.createQueue("sales");

   String addr = "ADDR:amq.direct/x512; {create: receiver, " +
        "link : {name : 'MY.RESP.QUEUE', " + 
        "x-declare : { auto-delete: true, exclusive: true, " +
                     "'qpid.max_size': 1000, 'qpid.policy_type': ring } } }";
   Destination queue = ssn.createQueue(addr);


   Destination topic =  ssn.createTopic("use.news");
   
   String addr = "ADDR:vehicles/bus; " + 
        "{ " + 
          "create: always, " +                        
          "node: " + 
          "{" +
               "type: topic, " +
               "x-declare: " +
               "{ " + 
                   "type:direct, " + 
                   "auto-delete: true, " +
                   "'qpid.msg_sequence': 1, " +
                   "'qpid.ive': 1" + 
               "}" +
          "}, " +
          "link: {name : my-topic, " +
              "x-bindings: [{exchange : 'vehicles', key : car}, " +
                           "{exchange : 'vehicles', key : van}]" + 
          "}" + 
        "}";
        
     Destination topic = ssn.createTopic(addr);

Comment 3 Jiri Kolar 2010-08-11 15:10:31 UTC
This functionality is present and works. 

But there are problems with certain parameters of destinations. I filled separate bz623198 for that

validated on RHEL5.5/RHEL4  i386 / x86_64  

packages:

# rpm -qa | grep -E '(qpid|openais|rhm)' | sort -u
openais-0.80.6-16.el5_5.2
openais-devel-0.80.6-16.el5_5.2
python-qpid-0.7.946106-11.el5
qpid-cpp-client-0.7.946106-11.el5
qpid-cpp-client-devel-0.7.946106-11.el5
qpid-cpp-client-devel-docs-0.7.946106-11.el5
qpid-cpp-client-ssl-0.7.946106-11.el5
qpid-cpp-mrg-debuginfo-0.7.946106-8.el5
qpid-cpp-server-0.7.946106-11.el5
qpid-cpp-server-cluster-0.7.946106-11.el5
qpid-cpp-server-devel-0.7.946106-11.el5
qpid-cpp-server-ssl-0.7.946106-11.el5
qpid-cpp-server-store-0.7.946106-11.el5
qpid-cpp-server-xml-0.7.946106-11.el5
qpid-java-client-0.7.946106-7.el5
qpid-java-common-0.7.946106-7.el5
qpid-tools-0.7.946106-8.el5
rhm-docs-0.7.946106-4.el5
rh-tests-distribution-MRG-Messaging-qpid_common-1.6-52


->VERIFIED


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