Qpid
  1. Qpid
  2. QPID-2860

C++ hello_xml example receives all message content, not just what's wanted

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7
    • Component/s: Qpid Examples
    • Labels:
      None
    • Environment:

      Linux (RHEL 5), Qpid svn trunk, xerces-c-2.7.0-8.el5

      Description

      In using the qpid/cpp/examples/messaging/hello_xml.cpp example to figure something out, I changed the sent message's <station> element to Boston. This should cause the message to not pass the XQuery set in the receiver. But when executed, the "Boston" message is still received.

      $ ./hello_xml
      <weather><station>Boston (BOS)</station><wind_speed_mph>16</wind_speed_mph><temperature_f>70</temperature_f><dewpoint>35</dewpoint></weather>

        Activity

        Hide
        Steve Huston added a comment -

        I think I know what's going on with this, but could someone with more exposure to the internals of qpidmessaging weigh in here please?

        The qpid/cpp/examples/xml-exchange example works correctly (only the xquery-selected records are received). The differences I see between that example and hello_xml is that when the exchange is bound, the xquery entry in the arguments are encoded as str16 in the working example (using the older qpid client API) and vbin16 in hello_xml (using the new messaging API).

        Show
        Steve Huston added a comment - I think I know what's going on with this, but could someone with more exposure to the internals of qpidmessaging weigh in here please? The qpid/cpp/examples/xml-exchange example works correctly (only the xquery-selected records are received). The differences I see between that example and hello_xml is that when the exchange is bound, the xquery entry in the arguments are encoded as str16 in the working example (using the older qpid client API) and vbin16 in hello_xml (using the new messaging API).
        Hide
        Gordon Sim added a comment -

        The problem is that the example (of which I am not a fan!) auto-creates the exchange it uses if it does not already exist. However it does not correctly specify the exchange type, so a topic exchange is created which of course ignores the xquery. Solution is to either declare an xml exchange named 'xml' before running the test and/or modify the address used to auto-create it correctly (I've checked in this fix).

        Show
        Gordon Sim added a comment - The problem is that the example (of which I am not a fan!) auto-creates the exchange it uses if it does not already exist. However it does not correctly specify the exchange type, so a topic exchange is created which of course ignores the xquery. Solution is to either declare an xml exchange named 'xml' before running the test and/or modify the address used to auto-create it correctly (I've checked in this fix).

          People

          • Assignee:
            Gordon Sim
            Reporter:
            Steve Huston
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development