0

Can somebody tell me Why the body and properties of a javax.jms.Message are made read-only after delivery in JMS spec. Is there any valid reason behind this. Thanks.

I will change the question a bit by reading Peter Lawrey comment. While i was reading one book it was mentioned as below:

> 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.

here i couldn't understand the last line which says:

which is especially useful with multiple consumers on the same client

what does that means. Thanks in advance.

4

1 回答 1

1

无法更改收到的消息,因为这意味着消息的其他接收者可能会或可能不会看到这些更改。假设更改接收到的消息更可能是错误而不是有用。

于 2013-05-29T18:06:13.667 回答