In addition to what Alan suggested (which is the preferred way) you can do the following as well. java -cp $QP org.apache.qpid.example.Spout -P=qpid.subject=hello "demoQueue"
If you type -h or --help, it will tell you how to specify these properties. regards, Rajith On Wed, Aug 3, 2011 at 9:34 AM, Alan Conway <[email protected]> wrote: > On 08/03/2011 06:47 AM, Pavel Moravec wrote: >> >> Hi all, >> comparing C++ and Java spout programs, I realized I am unable to set >> subject of a message using Java Spout program. >> >> C++ has syntax: >> ./spout -b localhost:5672 -c 1 -P '{subject:Some_subject}' testQueue >> >> but trying the same in Java client does not work: >> >> # cd /usr/share/doc/qpid-java-0.10/examples >> # ./run_example.sh org.apache.qpid.example.Spout -c 1 -P >> '{subject:Some_subject}' testQueue >> {P={subject:Some_subject}, c=1} >> Exception in thread "main" java.lang.StringIndexOutOfBoundsException: >> String index out of range: -1 >> at java.lang.String.substring(String.java:1937) >> at org.apache.qpid.example.Spout.setProperties(Spout.java:135) >> at org.apache.qpid.example.Spout.createMessage(Spout.java:124) >> at org.apache.qpid.example.Spout.<init>(Spout.java:97) >> at org.apache.qpid.example.Spout.main(Spout.java:146) >> # >> >> No variation to the -P parameter worked for me. Any idea how to set >> subject there? >> >> Kind regards, >> Pavel >> >> > > > address_string ::= <address> [ / <subject> ] [ ; <options> ] > > From > http://qpid.apache.org/books/trunk/Programming-In-Apache-Qpid/html/ch02s04.html#id2661206 > > > --------------------------------------------------------------------- > Apache Qpid - AMQP Messaging Implementation > Project: http://qpid.apache.org > Use/Interact: mailto:[email protected] > > --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:[email protected]
