0

We have a Spring cloud stream application with apache kafka binder. Can someone help with code snippets how to use kafka broker and zookeeper behind haproxy not just for load balancing reason but also for helping in blue green deployment.We have only one kafka that is read by both blue green components. We want to restrict the green component reading from kafka till it is swapped to become the active side.

Ram
  • 61
  • 5
  • That's not something that's done by Spring or Java properties... I feel like you need different bootstrap&Zookeeper addresses for the "correct" set of components – OneCricketeer Jun 03 '18 at 12:07
  • Could you please elaborate more. i am new to this so if you could give specific guidance it will be really helpful. – Ram Jun 03 '18 at 12:18
  • I don't quite understand your problem, but you say you have one Kafka cluster, not two. Therefore, there is no "blue/green" properties that can be applied for it, other than a completely different topic. HaProxy has nothing to do with that – OneCricketeer Jun 03 '18 at 12:23
  • Is there a way instead of giving broker url directly in the consumer we can give haproxy url and redispatch or forward call to broker through haproxy – Ram Jun 03 '18 at 12:32
  • Yes, you give `haproxy-kafka:9092`, but again, that has nothing to do with being blue/green. Note: only the first url lookup goes through HaProxy. Any subsequent produce/consume requests interact directly with brokers – OneCricketeer Jun 03 '18 at 12:34
  • can you help with achieving the above thing by adding some spring cloud stream config and haproxyconfig snippet – Ram Jun 03 '18 at 12:58
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/172336/discussion-between-ram-and-cricket-007). – Ram Jun 03 '18 at 12:59
  • I've never used HaProxy. Any examples you find elsewhere for TCP load balancing work for Kafka – OneCricketeer Jun 03 '18 at 13:00

0 Answers0