On 03/01/2013 01:04 PM, Tomáš Šoltys wrote:
Hi,

I am trying to setup an  XMLexchange and send some message to it. Here is
what I did but for some reason I do not see any messages on the exchange.
Can someone please tell me what am I doing wrong?


$> qpid-config -a admin/admin@cbgd03:29999 add exchange xml xml-exchange
$> qpid-config -a admin/admin@cbgd03:29999 add queue xml-queue
$> qpid-config -a admin/admin@cbgd03:29999 bind xml-exchange xml-queue
XMLtest -f xquery.xml


content of xquery.xml:
------------------------------------------------------------------------
let $w := ./FIXML return $w/TrdCaptRpt/@TransTyp = 2
------------------------------------------------------------------------


Python scripts which sends message:
------------------------------------------------------------------------
#! /usr/bin/python

import sys
from qpid.messaging import *
from qpid.log import enable, DEBUG

request_address = "xml-exchange; { node: { type: topic, x-declare: { type:
xml } }, create: never }"

Your binding uses XMLtest as a binding key and this has to match the routing key on any message before the xquery will even be evaluated. You could change the above address to "xml-exchange/XMLtest; { node: { type: topic, x-declare: { type: xml } }, create: never }" to do that (or else set the subject of the message before sending it).

reply_adress = "response/response_queue; { create: receiver, node: { type:
topic } }"

connection = Connection(host="myhost", port=21234, username="user",
password="pass")

try:
     connection.open()
     session = connection.session()
     sender = session.sender(request_address)

     message_text = "<FIXML><TrdCaptRpt TransTyp=2></TrdCaptRpt></FIXML>"
     message = Message(message_text, durable=True, reply_to=reply_adress)

     sender.send(message, sync=False, timeout=1000);
     sender.sync(1000)

     session.acknowledge()

except MessagingError,m:
     print m

finally:
     connection.close()
------------------------------------------------------------------------

Regards,
Tomas Soltys



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to