qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavel Moravec <pmora...@redhat.com>
Subject How to set subject in Java spout?
Date Wed, 03 Aug 2011 10:47:08 GMT
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, 

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message