Bug 847692 - XML Exchange demo does not work
XML Exchange demo does not work
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: Messaging_Programming_Reference (Show other bugs)
Development
Unspecified Unspecified
medium Severity unspecified
: 3.0
: ---
Assigned To: Jared MORGAN
Petr Matousek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-13 05:48 EDT by Joshua Wulf
Modified: 2015-08-09 21:22 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-01-22 10:27:40 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Wulf 2012-08-13 05:48:25 EDT
Based on "Using the XML Exchange" here: http://qpid.apache.org/books/0.16/Programming-In-Apache-Qpid/html/section-addresses.html

[root@deathstar2 mrg-tutorials]# cat rdu.query
let $w := ./weather
return $w/station = 'Raleigh-Durham International Airport (KRDU)'
and $w/temperature_f > 50
and $w/temperature_f - $w/dewpoint > 5
and $w/wind_speed_mph > 7
and $w/wind_speed_mph < 20 


drain -f "myxml; {link:{x-bindings:[{key:'weather',arguments:{xquery:\"$(cat rdu.query )\"}}]}}"

produces a huge error, ending with:

  File "/usr/lib/python2.6/site-packages/qpid/messaging/address.py", line 71, in tok2obj
    return eval(tok.value)
  File "<string>", line 1
    "let $w := ./weather
                       ^
SyntaxError: EOL while scanning string literal

Additionally, the program here: http://deathstar1.usersys.redhat.com:8080/TopicIndex/Books/editor/preview.html?skyneturl=http://skynet.usersys.redhat.com:8080/TopicIndex&topicid=10208

Does not work.
Comment 1 Gordon Sim 2012-08-13 12:21:51 EDT
The python client appears not to accept newlines in string literals within addresses.

Your example program looks to me like it needs to set the subject on the message being sent to 'weather'.
Comment 2 Joshua Wulf 2013-07-30 22:31:23 EDT
Now working:

[root@deathstar1 tmp]# python weather.py 

myxmlq; {create: always, link: {x-bindings: [{exchange: myxml, key: weather, arguments: {xquery: "let $w := ./weather return $w/station = 'Raleigh-Durham International Airport (KRDU)' and $w/temperature_f > 50 and $w/temperature_f - $w/dewpoint > 5 and $w/wind_speed_mph > 7 and $w/wind_speed_mph < 20"}}]}}

Message(subject=u'weather', properties={u'qpid.subject': u'weather', 'x-amqp-0-10.routing-key': u'weather'}, content='<weather><station>Raleigh-Durham International Airport (KRDU)</station><wind_speed_mph>16</wind_speed_mph><temperature_f>70</temperature_f><dewpoint>35</dewpoint></weather>')
Comment 5 Petr Matousek 2013-11-06 03:37:07 EST
The general xml demo that was using the xquery saved in the file and cat command was rewritten to python. The demo is functional. Content approved.

-> VERIFIED

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