0

I am using PCF for deploying my event driven microservice. It receives message from queue and then process and publish output to another topic. The application is going to be deployed in multiple data center for high availability. What I am currently considering is to deploy the application to two datacenter and it listens to the messages in both datacenter and then get the message processed. But will it be better to make the nearest datacenter of the queue to primarily listen the message and then when this datacenter is down only make the second datacenter listen the message. For this second approach, I may need to implement some circuit breaker to pause the primary and UP the secondary. Can you please provide your suggestion/experience in handling these applications.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
Albin
  • 277
  • 5
  • 19

1 Answers1

0

In general there is no simple straightforward solution as both DCs will be working in active-active mode and traffic can be routed to any side, but you can do followings:

  1. Deploy the apps in both data centre with different configuration so it will always listen to the queue(s) as defined in the code. Not the ideal...

  2. Talk to your infra guys (ex: MQ) to provide you a solution - technically its possible by having a GTM that sends you to the nearest site according to 'who' is asking

arjain13
  • 556
  • 3
  • 9
  • Thanks arjain. Can you please suggest on how this can be done if it is active-passive mode. I am using spring JMS for the development – Albin Feb 05 '21 at 16:56
  • For active-passive; you anyways need to start the app other site so you could simply have different configs and it will work, you may parametrise it as well as that will make the things easy. However if you want to connect across site when there is an issue with primary queue with any configuration (active-active or active-passive) then you need to manage this programmatically and connect to other site only if primary is not responding as expected.... – arjain13 Feb 08 '21 at 17:23
  • can you tell me how this can be achieved in spring boot. I am currently using the spring jms of spring boot. So when I create a listener for a queue, it will start listening for message from the queue. So if i deploy it to the two data centers, It will listen in both datacenters. How I can programmatically control which data center to listen at a point in time. – Albin Feb 08 '21 at 18:13