是否可以在 JMS 消息中发送字节数组

is it possible to send a byte array in a JMS message

是否可以在 JMS 消息中发送字节数组?

是的,有可能。

来自IBM support

A mediation can transcode a byte array into a message payload without changing the meaning of the message.

来自Oracle documentation

Although the JMS API allows the use of message properties with byte messages, they are typically not used, since the inclusion of properties may affect the format.

The primitive types can be written explicitly using methods for each type. They may also be written generically as objects. For instance, a call to BytesMessage.writeInt(6) is equivalent to BytesMessage.writeObject(new Integer(6)). Both forms are provided, because the explicit form is convenient for static programming, and the object form is needed when types are not known at compile time.