Bug 735322 - MRG-JCA Example Code and sample *-ds.xml file should be modified to use named queues/topics as opposed to AMQP exchange names
Summary: MRG-JCA Example Code and sample *-ds.xml file should be modified to use named...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: qpid-jca
Version: 2.0
Hardware: All
OS: All
high
high
Target Milestone: 2.1.2
: ---
Assignee: Weston M. Price
QA Contact: MRG Quality Engineering
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-02 10:24 UTC by Weston M. Price
Modified: 2016-02-22 00:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-07 17:43:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Weston M. Price 2011-09-02 10:24:18 UTC
Currently in the JCA example code, as well as the sample *-ds.xml file  we provide we use the following configuration for destinations:


<mbean code="org.jboss.resource.deployment.AdminObject"
         name="qpid.jca:name=HelloTopic">
     <attribute name="JNDIName">HelloTopic</attribute>
     <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
     <attribute name="Type">javax.jms.Destination</attribute>
     <attribute name="Properties">
        destinationType=TOPIC
        destinationAddress=amq.topic
     </attribute>
  </mbean>

  <mbean code="org.jboss.resource.deployment.AdminObject"
         name="qpid.jca:name=HelloQueue">
     <attribute name="JNDIName">HelloQueue</attribute>
     <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
     <attribute name="Type">javax.jms.Destination</attribute>
     <attribute name="Properties">
        destinationType=QUEUE
        destinationAddress=amq.direct
     </attribute>
  </mbean>

This really isn't correct as amq.topic and amq.direct are exchanges rather than destinations. While this works in the example, this is really a misconfiguration and is causing quite a bit of confusion in QE. Similarly, I believe this will cause confusion for our customers as well. 

The configuration should be modified to use actual queue/topic names versus the exchange names.

Comment 1 Weston M. Price 2011-09-02 10:41:32 UTC
Also, as per comments from team members, we should probably add a Topic listener (pub-sub) example as well.

Comment 2 Weston M. Price 2011-09-03 18:06:00 UTC
There is more work involved in this task than the above description allows for so I am going to enumerate the work that should/is going into this task:

1) Modify the qpid-jca-ds.xml file in both the adapter proper and the examples to use named destinations versus exchange names:

Example:

 <mbean code="org.jboss.resource.deployment.AdminObject"
         name="qpid.jca:name=HelloQueue">
     <attribute name="JNDIName">HelloQueue</attribute>
     <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
     <attribute name="Type">javax.jms.Destination</attribute>
     <attribute name="Properties">
        destinationType=QUEUE
        <!--note if you require the older BURL syntax, uncomment the line below and comment the ADDR syntax line>
        destinationAddress=hello.Queue;{create:always, node:{type:queue, x-declare:{auto-delete:true}}}
        -->
        destinationAddress=direct://amq.direct//hello.Queue?autodelete='true'
     </attribute>
  </mbean>

2) Create two new MDB(s) 
    QpidListenerHelloBean
    QpidListenerGoodbyeBean

Based on configuration options, the HelloBean will receive a message and publish it to the GoodByeBean showing two different named listeners and the messages that each can process independently.

3) Create a new TopicSubscriber MDB to listen on a topic and print the results to the log/console

Example config:

  <mbean code="org.jboss.resource.deployment.AdminObject"
         name="qpid.jca:name=HelloTopic">
     <attribute name="JNDIName">HelloTopic</attribute>
     <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='qpid-ra-0.10.rar'</depends>
     <attribute name="Type">javax.jms.Destination</attribute>
     <attribute name="Properties">
        destinationType=TOPIC
        <!--note if you require the older BURL syntax, uncomment the line below and comment the ADDR syntax line>
        destinationAddress=BURL:topic://amq.topic//hello.Topic?routingKey='hello.Topic'
        destinationAddress=amq.topic/hello.Topic
        -->
        destinationAddress=topic://amq.topic//hello.Topic?routingKey='hello.Topic',autodelete='true'
     </attribute>
  </mbean>

4) Provide new options in the client code (both web and RMI) to either post to a queue or a topic. Currently, we only post the HelloQueue

5) Provide new options in the Web client to either use the EJB to post the message, or the ConnectionFactory/Connection etc objects. 

6) Provide new options in the Web client to use XA (via the UserTransaction) to publish a message under an XA transaction. Currently, if not using EJB (which is XA by default) we do use XA.

7) Provide a new example showing how to run a client outside of JBoss using the non-JCA connection factory hosted in JBoss JNDI, post to a Queue or Topic and receive a response. This is akin to the request/response example in the Qpid JMS Client examples. Also, allow this code to run multiple threads for pub/sub.

8) Provide spout/drain type functionality in all the client code by allowing the client to specify a message count (i.e. the number of messages to send)

9) Modify client/server code to use logging rather than system out println. Currently the client code uses System.out

10) Support better logging/debugging

11) General cleanup and Documentation updates. 

A majority of this work is complete and exists in 

git://github.com/astitcher/qpid-jca.git

branch

wp-BZ-735322

Comment 3 Andrew Stitcher 2011-09-22 13:30:58 UTC
This has been fixed in package qpid-java-jca-0.10-10


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