Bug 847692 - XML Exchange demo does not work
Summary: XML Exchange demo does not work
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: Messaging_Programming_Reference
Version: Development
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: 3.0
: ---
Assignee: Jared MORGAN
QA Contact: Petr Matousek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-08-13 09:48 UTC by Joshua Wulf
Modified: 2015-08-10 01:22 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-22 15:27:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joshua Wulf 2012-08-13 09:48:25 UTC
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 16:21:51 UTC
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-31 02:31:23 UTC
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 08:37:07 UTC
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.