Hi,
I'm providing Qpid based service, which allows client's applications
to connect to the broker, send requests, receive responses and receive
broadcasts (via topic exchange). Since there are different clients
connecting with their own applications, the clients are strictly
limited to do only some actions. Currently, I have fully working test
application, which is written in Java and is relying on the old Qpid
API. Since the Qpid API is not really supported, I was trying to
rewrite this application to JMS. Unfortunately, I run into several
problems:
1) To send requests, the client should send the message to a direct
exchange specific for every client. The message needs to have a client
specific routing key defined, which routes the message to a queue
where it is picked up by the server application. The exchanges are
predefined and the client is forbidden to define exchanges. Doing this
with Qpid API is not a problem. I tried to do so in the JMS with
following code (it is based on the JMS examples):
_producer = session.createProducer(null);
TextMessage txtMessage;
txtMessage = session.createTextMessage("<?xml version=\"1.0\"
encoding=\"UTF-8\" standalone=\"no\"?><FIXML>.....</FIXML>");
_producer.send(requestDestination, txtMessage);
The destination called requestDestination is defined using JNDI as
direct://service.CLIENT_X/?routingkey='CLIENT_X.XYZ'. However, when I
run this code against the broker, the message is not send and it fails
with "ACL denied exchange declare request" (however, this error
appears only in the broker log file, not on the client). Running the
program with "-Dqpid.declare_exchanges=FALSE" doesn't help. I
discussed this problem here already a year ago, it should be caused by
BasicMessageProducer_0_10, method declareDestination. However, when I
comment out the exchangeDeclare call in this method, it fixes the
problem with ACL, but it cause's my broker to crash after processing
the message, which I don't know how to fix.
2) To receive responses, the client has to create his own queue and
bind the queue with another direct exchange. The queue name as well as
the routing key have to be in a specific format. The queue needs to be
autodelete, exclusive and have RING policy type with max_size 1000. I
tried following JMS code:
MessageConsumer responseConsumer = session.createConsumer(responseDestination);
responseConsumer.setMessageListener(this);
Where response destination is
direct://service.response/service.tmp.CLIENT_X.123456_resp?routingkey='CLIENT_X.56789'&autodelete='TRUE'&exclusive='TRUE'.
But I don't know, how to define the policytype=RING and max_size=1000.
All parameters I tried are ignored. And without proper policy type and
queue size, I fail again on ACL (this time, the error handling works
fine => I get a proper exception on the client side). How can I
specify the policytype and max_size?
3) To receive broadcasts, the clients have to create their own queue
and subscribe the broadcasts using an binding between topic exchange
and their queue. I tried to use the same consumer as in point 2), but
since this is an topic exchange, I cannot use following destination
direct://service.broadcast/service.tmp.CLIENT_X.123456_bcast?routingkey='#.weather.usa.#'&autodelete='TRUE'&exclusive='TRUE'.
It is forcing me to use the Topic JNDI. But if I specify the topic
JNDI just as #.weather.usa.#, it is trying to bind the default topic
exchange amq.topic (which is different from the exchange I want to
use) and it uses queue with different name and parameters, then what
the client is allowed to. How can I setup binding between a specific
topic exchange and my own very specific queue? (possibly with more
bindings to the same queue)
The configuration on the broker may look quite strict, but I see that
as the only way to provide a stable service to all connected clients.
Since the service is already running, I'm not free to change the
configuration as I want. Therefore, I prefer finding a solution which
would fit the configuration.
FYI: I was trying this with Qpid 0.5, 0.6 as well as the latest trunk.
The broker is C++ ...
Thanks & Regards
Jakub Scholz
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]