Reputation: 23
I am using int-kafka:message-driven-channel-adapter for consuming message from topic and we have 3 different lower environments(dev/perf/stage) but the topic for all lower environments is same so in our case, kafka message is getting consumed and published thrice as app is deployed in those environments so we are trying to add a boolean flag to not consume messages from other environments keeping just one env active at a time? Is there alternate way how can this be achieved in spring integration int-kafka:message-driven-channel-adapter?
Can you also explain auto startup field on int-kafka:message-driven-channel-adapter and setting it to false will stop consuming messages from the topic(I might be completely wrong here!)
can you please help?
Upvotes: 0
Views: 163
Reputation: 121542
If all of your environments are connected to the same middleware, then it is really not a separation of environment. You should consider to have separate Apache Kafka brokers for those instances.
Yes, that auto-startup="false"
means that this channel adapter is not going to be started automatically and therefore it is not going to consume records from the topic. You can have this attribute resolved from a property placeholder, so whenever you need to have it not started to set a respective property to false
. However this works only once at startup: the changes to the properties file when application is ran don't make any affect.
Upvotes: 0