jmsgoogle-cloud-pubsubmessagebroker

Does Google Pub/Sub queue or topic?


I am familiar with JMS and novice with Google Pub/Sub.

In JMS there are 2 options:

I believe that Google Pub/Sub should support something like this, but a quick Googling didn't help me to answer that question.

Please point me out to the corresponding documentation part.


Solution

  • As the name "Pub/Sub" indicates, Google Pub/Sub supports publish/subscribes semantics which correspond to JMS topics. It doesn't support point-to-point semantics which correspond to JMS queues, at least not directly.

    You can see an overview of the semantics in the documentation. The "Publisher-subscriber relationships" section may be helpful. To be clear, this documentation does use the word queue in two places:

    1. In the "Pub/Sub message flow" section: "When a message is acknowledged by the subscriber, it is removed from the subscription's message queue."
    2. In the "Common use cases" section: "For example, a large queue of tasks can be efficiently distributed among multiple workers, such as Google Compute Engine instances."

    The term queue here is being used to refer to the actual subscription on the topic (i.e. where the messages are placed for subscribers to consume). Furthermore, the architectural overview includes this diagram: Google Pub/Sub architecture This diagram demonstrates how multiple subscribers can receive messages from the same subscription (e.g. for balancing workloads). This would be akin to the "shared subscription" functionality added for topics in JMS 2.