Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Send a message using C++ which will be a JMS TextMessage

$
0
0
Hi List,

I am sending messages to a JMS Service which runs at a third party.

I use C++ qpid 0.28 with amqp 1.0.

When the message is created it looks like this:

std::string messageContent("example text");
qpidMessage.setContentType("text/plain");
qpidMessage.setContent(qpid::types::Variant(messageContent));

The third party told me that it comes in as a ByteMessage but it must be
a TextMessage.

I tried it out using an own java JMS Client (also with qpid 0.28):

Message amqpMsg = consumer.receive();
if (amqpMsg instanceof javax.jms.TextMessage)

javax.jms.TextMessage txMsg = (javax.jms.TextMessage)
amqpMsg;
log.info("TxtMsg: " + txMsg.toString());

else

log.info("NO Text Message: " + amqpMsg.toString());

I can also see that the message comes out as a ByteMessage.

I also wrote a test prorgram in java to send a message and the JMS
client could read it as TextMessage.

Does anyone of you have an idea how I can create a JMS TextMessage using
a c++ qpid program?

Is it right in from an AMQP perspective that it must be possible to
create a TextMessage?

Regards,
Andreas

Viewing all articles
Browse latest Browse all 5648

Trending Articles