0

We have a Spring Boot application that uses the standard layer model (Controllers, Services, DAO).

Our service layer is using JMS events to produce & consume events.

We would like to consider migrating from ActiveMQ to Google's Pub-Sub (primarily since there is a managed solution on GCP unlike ActiveMQ).

  1. Is it possible to implement a queue using Pub-Sub (e.g. produce once, consume once unlike a topic with multiple consumers/subscribers)?
  2. Are there any examples showing Pub-Sub implementation within the model of the 3 layers in Spring (controllers, services, DAO)? All we could find is a simple Pub-Sub application using Spring Boot. We are interested in seeing what change it will require from our service layer which uses an onMessage(Event e) method.
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
Urbanleg
  • 6,252
  • 16
  • 76
  • 139

1 Answers1

1

Google's Pub-Sub doesn't support point-to-point semantics like those specified for JMS queues. However, you may be able to approximate these semantics by using multiple consumers on one subscription on a topic. See this answer for more details on that.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43