Pass message payload by reference: Potential benefits for each processing step

For each processing step taken by your JMS messaging application, check this table to see when and why there is a potential performance benefit in enabling the "pass message payload by reference" properties on the associated connection factory or activation specification.

當傳送大型物件訊息或位元組訊息時,為了序列化、解除序列化及複製訊息有效負載,可能會耗用大量的記憶體和處理器成本。 如果您在 Connection Factory 或啟動規格上啟用 pass message payload by reference 內容,您會通知預設傳訊提供者置換 JMS 1.1 規格,這項資料的複製有可能會縮減或略過。

CAUTION:
定義這些內容所略過的 JMS 規格部分,以確保訊息資料的完整性。 任何使用這些內容的 JMS 應用程式,都必須嚴格遵循「依參照傳遞 JMS 訊息有效負載的原因和時機」主題中所說明的規則,否則,會有喪失資料完整性的風險。
如果要依參照傳遞訊息有效負載,請在 Connection Factory 和啟動規格上設定下列內容:
producerDoesNotModifyPayloadAfterSet (Connection Factory) 或 forwarderDoesNotModifyPayloadAfterSet(啟動規格)
當啟用這個內容時,Connection Factory 所產生或啟動規格所轉遞的物件或位元組訊息倘若設在訊息中,就不會進行複製,只有在絕對必要之時,才會序列化。 傳送這些訊息的應用程式,在訊息內設定了資料之後,便無法修改資料。
consumerDoesNotModifyPayloadAfterGet
當啟用這個內容時,只有在絕對必要之時,才會將透過 Connection Factory 或啟動規格收到的物件訊息序列化。 應用程式不能修改從這些訊息取得的資料。
Table 1. Potential performance benefits for each processing step taken by your producer, consumer or forwarder application. The first column of the table lists the processing steps for the objects and bytes messages. The second column indicates if there is a possibility for performance improvement. The third column provides a brief explanation about the processes and the properties.
Processing step Is there potential for performance improvement? Explanation
Object messages with producer and consumer applications    
An object message is sent to a consumer application in the same JVM. The producerDoesNotModifyPayloadAfterSet and consumerDoesNotModifyPayloadAfterGet properties are both enabled. Yes Under certain conditions, the payload object is passed by reference to the consumer application.

If the message is not persistent or transacted, and the consumer application is immediately available, the payload object might never be serialized.

An object message is produced with the producerDoesNotModifyPayloadAfterSet property enabled, then received by a consumer application for which the consumerDoesNotModifyPayloadAfterGet property is not enabled. No No benefit is gained because the consumer application does not have the consumerDoesNotModifyPayloadAfterGet property enabled.
An object message is sent to a single consumer application in a different JVM. The producerDoesNotModifyPayloadAfterSet and consumerDoesNotModifyPayloadAfterGet properties are both enabled. No No benefit is gained because the single consumer application is in another JVM.
An object message is received by multiple consumer applications (a topic) that all have the consumerDoesNotModifyPayloadAfterGet property enabled and are all running in the same JVM. Yes All consumer applications with the consumerDoesNotModifyPayloadAfterGet property enabled might receive a reference to the same object, though this is not guaranteed.
Object messages with forwarder applications    
An object message is forwarded and the forwarder application accesses the payload of the message. The consumerDoesNotModifyPayloadAfterGet and producer/forwarderDoesNotModifyPayloadAfterSet properties are enabled. Yes There is a potential performance benefit in the following cases:
  • The producer of the forwarded message has the producerDoesNotModifyPayloadAfterSet property enabled and is in the same JVM as the forwarder application.
  • The consumer of the forwarded message has the consumerDoesNotModifyPayloadAfterGet property enabled and is in the same JVM as the forwarder application.
An object message is forwarded and the forwarder application accesses the payload of the message. Only the producer/forwarderDoesNotModifyPayloadAfterSet property is enabled. Yes There is a potential performance benefit if the consumer of the forwarded message has the consumerDoesNotModifyPayloadAfterGet property enabled and is in the same JVM as the forwarder application.
An object message is forwarded and the forwarder application does not access the payload of the message. No If the payload of the object message is not accessed by the forwarder application then the producer/forwarderDoesNotModifyPayloadAfterSet and consumerDoesNotModifyPayloadAfterGet properties have no effect for the forwarder application. Benefits gained from the original producer application and ultimate consumer application are maintained.
Object messages with mediations    
An object message is sent to a mediated service integration bus destination. No If the object message is sent to a mediated destination then no performance benefit is gained by enabling the producerDoesNotModifyPayloadAfterSet property.
Bytes messages with consumer applications    
A bytes message is sent to any consumer application. The producerDoesNotModifyPayloadAfterSet property is enabled. Yes The part of the JMS specification that mandates copying the data on setting into the message is bypassed, saving a copy of the bytes data.
A bytes message is received with the consumerDoesNotModifyPayloadAfterGet property enabled. No The JMS API does not allow bytes data to be passed by reference back to consumer code (BytesMessage.readBytes methods).
A bytes message is received by multiple consumers (a topic) that all have the consumerDoesNotModifyPayloadAfterGet property enabled. No The JMS API does not allow bytes data to be passed by reference back to consumer code (BytesMessage.readBytes methods).
Bytes messages with forwarder applications    
A bytes message is forwarded. No There is no benefit gained from enabling any of the "pass message payload by reference" properties.

指出主題類型的圖示 概念主題



時間戳記圖示 前次更新: July 9, 2016 11:10
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cjn_passbyref_steps
檔名:cjn_passbyref_steps.html