zoukankan      html  css  js  c++  java
  • 【转】Difference between Point-To-Point and Publish/Subscribe JMS Messaging Models

    Difference between Point-To-Point and Publish/Subscribe JMS Messaging Models

    Point-to-Point (PTP) and Publish/Subscribe (Pub/Sub) are two types of messaging models or messaging domains provided by JMS. Both of these have significant differences and should be used as per the application’s requirement. For instance, point-to-point messaging should be used when each message delivered by a producer should be consumed successfully by one receiver andpublish/subscribe messaging should be used when each message delivered by a producer should be consumed by zero or more receivers.

    Here is a more detailed difference between the two messaging models:

     

    Point-to-Point (Queue)

    Publish-Subscribe (Topic)

    1. Each message is addressed to a virtual channel known as Queue Each message is addressed to a virtual channel know as Topic
    2. One-to-One i.e. a message delivered by a producer is consumed by only one receiver One-to-Many i.e. a message delivered by a producer (publisher) can be consumed by zero or more receivers (subscribers)
    3. A queue can have multiple receivers, but each message is consumed by only one receiver A topic can have multiple receivers and every receiver receives a copy of each message
    4. Pull-based model i.e. client polls the queue for new messages and sends the request Push-based model i.e. messages are broadcasted to all the subscribers without them having to poll the topic
    5. Messages are retained in the queue until they are delivered to the receiver. The receiver can fetch the message even if it was not running when producer sent the messages. Messages are retained in the topic until they are delivered to the “current“ subscribers.There is an option to have durable subscriptions in pub-sub model which allows the subscriber to dis-connect, reconnect again and collect the messages that were delivered when it was not active.
    6. The receiver acknowledges the successful processing of a message. Acknowledgment is optional.

    Thus whether to use queue or topic as JMS message destination, depends solely on the requirements of a specific application.

    转自: http://verticalhorizons.in/difference-between-point-to-point-and-publishsubscribe-jms-messaging-models/

  • 相关阅读:
    kbmMW 5.07.00试用笔记
    在 Andriod/IOS 程序中使用自定义字体
    【转】Delphi 10.3关于相机该注意的细节
    Delphi 10.3终于来了
    REST easy with kbmMW #17 – Database 6 – Existing databases
    【go】1环境搭建go语言介绍
    【ESSD技术解读02】企业级利器,阿里云 NVMe 盘和共享存储
    项目实战总结以及接入UAPM
    RocketMQ 5.0 POP 消费模式探秘
    Cube 技术解读 | 详解「支付宝」全新的卡片技术栈
  • 原文地址:https://www.cnblogs.com/amigo/p/5605976.html
Copyright © 2011-2022 走看看