2010-04-21 22 views

回答

5

我會說一般情況下沒有,儘管它確實取決於上下文以及在邏輯上如何在應用程序中考慮通信。

如果消息發送是偶然的一次性事件,並且後續消息完全不相關,那麼是的,如果您可以容忍成本。

如果你確實有一個漫長而又合乎邏輯的交互序列,只要你不會搞亂你的線程,那麼在一個會話中執行它們是有意義的。

會話實際上爲一系列消息提供了便利,因此根據定義,它意味着處理多個消息。

這裏是什麼文件說:

環節有幾個目的:

* It is a factory for its message producers and consumers. 

* It supplies provider-optimized message factories. 

* It supports a single series of transactions that combine work 

跨越了生產者和消費者 成原子單位。

* It defines a serial order for the messages it consumes and the 

它產生的消息。

* It retains messages it consumes until they have been acknowledged. 

* It serializes execution of message listeners registered with its 

消息消費者。

相關問題