0

I have a question about Netflix Eureka and Blue\Green Pattern....

Recently I wrote a blog about Micro Services and Transactions, there I tried to cover the topic of the of Blue\Green pattern but I have a question about the subject.

I try to start my Service in 'OUT_OF_SERVICE' mode with the following configuration

eureka:
  instance:
    initialStatus: OUT_OF_SERVICE
    instanceEnabledOnit: false

Initially everything is OK, the service starts with OUT_OF_SERVICE and with the JSON interface of the Eureka I like to convert Service to 'UP' state. The problem is, I also have Health Check functionality implemented for my service (a class implementing 'HealthCheck' interface automatically detected and registered by Eureka), this HealthCheck functionality overwriting my 'OUT_OF_SERVICE' status and taking the service to UP state before I can intervene with 'Blue\Green' pattern.

HealtCheck interface of Eureka does not give me the information about the actual state of the service, so I can't check before it is 'OUT_OF_SERVICE' or not and actually I was expecting that it can go from OUT_OF_SERVICE to UP (a state transition from DOWN to UP is understandable but I was OUT_OF_SERVICE for me means I don't want to run this service).

You can find the detailed discussion here 'https://mehmetsalgar.wordpress.com/2016/11/05/micro-services-fan-out-transaction-problems-and-solutions-with-spring-bootjboss-and-netflix-eureka/#blue_green'.

So my question is how to have 'blue\green' pattern and the same time have the 'HealthCheck' functionality.

Thx for answers

posthumecaver
  • 1,584
  • 4
  • 16
  • 29
  • Why not also have your health check return a status of `OUT_OF_SERVICE` until you are ready to bring the service up? – Ryan Baxter Feb 08 '17 at 12:34
  • I think this will byte my actual version of my services (green services I mean). I always two set of services, one actual version 'green services' and future version 'red services'. If I return by default 'OUT_OF_SERVICE' from health services, in the case of restart, my actual services will also go to 'OUT-OF-SERVICE' mode... – posthumecaver Feb 15 '17 at 08:26
  • Maybe you could use some kind of environment variable to set whether the service is a future service and should be return `OUT_OF_SERVICE` and whether it is a current versions and should return `DOWN` or `UP` on a restart. – Ryan Baxter Feb 15 '17 at 16:02

0 Answers0