How to understand the “synchronous” and “asynchronouns” messaging in JMS?

前端 未结 4 1843
温柔的废话
温柔的废话 2020-12-24 02:18

After reading some document of JMS, I totally puzzled by the phrase synchronous and asynchronouns.

See this page: http://docs.oracle.com/cd

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-24 03:11

    Like I understand this:

    asynchronous - MessageListener: Use this on a server that listens to a queue. When a message arrives, then deal with it immediately. The server keeps listening to this queue.

    synchronous - consumer.receive(1000): Use this on a client applications that now and then needs to check if a message is intend for this client. Example: poll every 60 seconds. This only opens a connection to the server shortly. The 1000 milliseconds will keep this connection open. If a message arrives within these 1000 milliseconds, then the message is consumed and the connection is closed.

提交回复
热议问题