Hello,

Using JMS, I send a BytesMessage to a broker. I try to receive the message 
using Proton-c. However, when extracting the bytes from the body, I find none.


As you can see from the below code/output, I am receiving a bytesMessage () but 
the size of proton::binary extracted is "0".


Can you please assist me finding the issue?


PS: The same code works on Solaris without any issue.


JMS code

-------------------

BytesMessage message = session.createBytesMessage();
message.writeBytes("message\0message".getBytes());
messageProducer.send(message);



Handler code

-------------------

void MessagingReceiveOneHandler::on_message(proton::delivery &d, 
proton::message &m)
{
   std::cout << "MessagingReceiveOneHandler::on_message as_string: " << 
m.body().as_string() << std::endl;
   std::cout << "MessagingReceiveOneHandler::on_message content_type: " << 
m.content_type() << std::endl;
   std::cout << "MessagingReceiveOneHandler::on_message annotation_map: " << 
m.message_annotations() << std::endl;

   proton::binary data = proton::get<proton::binary>(m.body());
   std::cout << "MessagingReceiveOneHandler::on_message bytes_size: " << 
data.size() << std::endl;
}


Output

---------------

MessagingReceiveOneHandler::on_message as_string: message message
MessagingReceiveOneHandler::on_message content_type: application/octet-stream
MessagingReceiveOneHandler::on_message annotation_map: {:"x-opt-jms-dest"=0, 
:"x-opt-jms-msg-type"=3}
MessagingReceiveOneHandler::on_message bytes_size: 0


Regards,

Adel

Reply via email to