ActiveMQ, why not use BytesMessage with properties?
-
26-01-2021 - |
Question
using ActiveMQ I want to serialize my objects with protocol buffers (*).
Then I have an byte array.
Now I read that ByteMessage should not be used with properties:
http://activemq.apache.org/nms/msdoc/1.5.0/vs2005/html/T_Apache_NMS_IBytesMessage.htm
(They have the same text in the java documentation, too)
Where is the problem, and when will the problems occur?
(*) We use this format internally, if possible I want to use is as message body, too.
Solution
There shouldn't be any problem with using message properties in BytesMessage object with ActiveMQ. The NMS docs just have some similar warnings as the JMS spec as its meant to be generic per provider so in other providers this might not be the case but should work without any issue in ActiveMQ.