On 03/21/2013 05:27 PM, Jan Bares wrote:
How can I tell qpid-send to use specific content type? I need to set content type to 
"text/plain" so on receiving end the Java JMS client will get 
javax.jms.TextMessage instead of javax.jms.BytesMessage.

At present there isn't an option to control that unfortunately. It would be easy to add though, e.g. as attached. Would that work for you?
Index: src/tests/qpid-send.cpp
===================================================================
--- src/tests/qpid-send.cpp	(revision 1459421)
+++ src/tests/qpid-send.cpp	(working copy)
@@ -92,6 +92,7 @@
     uint groupSize;
     bool groupRandSize;
     uint groupInterleave;
+    std::string contentType;
 
     Options(const std::string& argv0=std::string())
         : qpid::Options("Options"),
@@ -154,6 +155,7 @@
             ("group-size", qpid::optValue(groupSize, "N"), "Number of messages per a group (if group-key specified)")
             ("group-randomize-size", qpid::optValue(groupRandSize), "Randomize the number of messages per group to [1...group-size] (if group-key specified)")
             ("group-interleave", qpid::optValue(groupInterleave, "N"), "Simultaineously interleave messages from N different groups (if group-key specified)")
+            ("content-type", qpid::optValue(contentType, "CONTENT-TYPE"), "set content type of message")
             ("help", qpid::optValue(help), "print this usage statement");
         add(log);
     }
@@ -407,6 +409,8 @@
                     msg.getProperties()[SN] = sent;
                 if (groupGen.get())
                     groupGen->setGroupInfo(msg);
+                if (opts.contentType.size())
+                    msg.setContentType(opts.contentType);
 
                 if (opts.timestamp)
                     msg.getProperties()[TS] = int64_t(

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to