| Summary: | MRG-JCA Example Code and sample *-ds.xml file should be modified to use named queues/topics as opposed to AMQP exchange names | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Weston M. Price <wprice> |
| Component: | qpid-jca | Assignee: | Weston M. Price <wprice> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | MRG Quality Engineering <mrgqe-bugs> |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 2.0 | CC: | astitcher, cdewolf, jpechane, tross |
| Target Milestone: | 2.1.2 | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-12-07 17:43:32 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Also, as per comments from team members, we should probably add a Topic listener (pub-sub) example as well. 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
This has been fixed in package qpid-java-jca-0.10-10 |
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.