有人能告诉我为什么javax.jms.Message的身体和属性在JMS规范中交付后才被只读。这背后有什么合理的理由。谢谢。
我将通过阅读彼得·劳瑞评论来稍微改变这个问题。当我阅读一个书时,它被提到如下:
> Why are both the body and properties made read-only after delivery? It
> allows the JMS provider more flexibility in implementing the Message
> object. For example, a JMS provider may choose to stream a
> BytesMessage or StreamMessage as it is read, rather than all at once.
> Another vendor may choose to keep properties or body data in an
> internal buffer so that it can be read directly without the need to
> make a copy, which is especially useful with multiple consumers on the
> same client.在这里,我无法理解最后一行:
,对于同一客户端上的多个使用者尤其有用。
那是什么意思。提前谢谢。
发布于 2013-05-29 18:06:13
无法更改接收到的消息,因为这将意味着消息的其他接收方可能看到或可能看不到这些更改。假设更改接收到的消息更可能是一个错误而不是有用的。
https://stackoverflow.com/questions/16820865
复制相似问题