On 09/16/2013 09:57 PM, Ted Ross wrote:
The following is a brief example of the router's use to illustrate how
it works:

[Refer to the README file for building instructions]
[The router executable and Proton Messenger examples are assumed to be
in the execution path]

Run the following in separate terminal windows:

$ router/dispatch-router -c <path-to-config-file>
$ recv amqp://0.0.0.0:5672/my_address/1
$ recv amqp://0.0.0.0:5672/my_address/1
$ recv amqp://0.0.0.0:5672/my_address/another
$ send -a amqp://0.0.0.0:5672/my_address/1 CONTENT
$ send -a amqp://0.0.0.0:5672/my_address/another CONTENT

You can also run a similar example using the qpid::messaging examples (assuming amqpc.so loaded and libqpid-proton found):

 drain -f --connection-options {protocol:amqp1.0} abc
 drain -f --connection-options {protocol:amqp1.0} abc
 drain -f --connection-options {protocol:amqp1.0} xyz
spout --content one --connection-options {protocol:amqp1.0} -P x-amqp-to=abc ignored spout --content two --connection-options {protocol:amqp1.0} -P x-amqp-to=xyz ignored

At present the router works off the 'to' field in the message which is not set by default for the qpid::messaging library, rather than the target address for the sender link.

Also, the address format that qpid::messaging uses treats an unquoted '/' as the divider between node and subject, so if you want to use the exact same addresses as in Ted's example above you need to ensure they are quoted e.g. drain -f --connection-options {protocol:amqp1.0} "'my_address/1'", so that the whole is taken as the source.

The first line starts the router process (assumed to be configured to
listen on port 5672).  The "recv" examples create connections to the
router and subscribe to two different address (two use the same
address).  The "send" examples create connections to the router and send
messages to their respective addresses.

If everything works, the first sent message will be received by the
first two receivers and the second sent message will be received only by
the third receiver.

The same behaviour should be seen.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to