1

Is it possible to send a stringstream containing binary over activemq? If so, how is this done?

I know the Java version of activemq has a feature called BlobMessage or StreamMessage to do so, however, this isn't implemented in the c++ version yet. I've already read about the BytesMessage class however I can't find any good c++ examples that implements it.

Thanks.

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
user459811
  • 2,874
  • 10
  • 37
  • 63

1 Answers1

2

If you've downloaded the source for ActiveMQ-CPP then look for the Unit Tests in the the src/test folder that deal with BytesMessage, that will show you how its done. Also the StreamMessage is supported, BlobMessage is not though.

Here is the API Doc for BytesMessage in CMS. http://activemq.apache.org/cms/api_docs/activemqcpp-3.2.5/html/classcms_1_1_bytes_message.html

and StreamMessage http://activemq.apache.org/cms/api_docs/activemqcpp-3.2.5/html/classcms_1_1_stream_message.html

-Tim www.fusesource.com

Tim Bish
  • 17,475
  • 4
  • 32
  • 42
  • c++ std::string can hold binary data with embedded nulls. I was wondering if this std::string was sent with a TextMessage, would the std::string be truncated because of the embedded nulls? What if ByteMessage's writeString() was used? Would this yield the same behavior? Thanks. – user459811 Mar 07 '11 at 17:21
  • I think it should preserve the embedded nulls, there's only one way to find out....try it. – Tim Bish Mar 08 '11 at 01:09