Skip to content

Commit

Permalink
Avoid publishing avro-json if topic not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
lassetyr committed May 15, 2024
1 parent aa0b60a commit 2b15976
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ public void configure() throws Exception {
.routeId("anshar.pubsub.et.producer.avro.bin");

from("direct:publish.et.avro.pubsub.json")
.process(siriAvroJsonSerializer)
.to(pubsubEtAvroJsonTopic)
.choice().when().constant(!pubsubEtAvroJsonTopic.isEmpty())
.process(siriAvroJsonSerializer)
.to(pubsubEtAvroJsonTopic)
.endChoice()
.routeId("anshar.pubsub.et.producer.avro.json");
} else {
log.info("Publish Avro-ET to pubsub disabled");
Expand Down Expand Up @@ -105,8 +107,10 @@ public void configure() throws Exception {
.routeId("anshar.pubsub.vm.producer.avro.bin");

from("direct:publish.vm.avro.pubsub.json")
.process(siriAvroJsonSerializer)
.to(pubsubVmAvroJsonTopic)
.choice().when().constant(!pubsubVmAvroJsonTopic.isEmpty())
.process(siriAvroJsonSerializer)
.to(pubsubVmAvroJsonTopic)
.endChoice()
.routeId("anshar.pubsub.vm.producer.avro.json");
} else {
log.info("Publish Avro-VM to pubsub disabled");
Expand Down Expand Up @@ -144,8 +148,10 @@ public void configure() throws Exception {
.routeId("anshar.pubsub.sx.producer.avro.bin");

from("direct:publish.sx.avro.pubsub.json")
.process(siriAvroJsonSerializer)
.to(pubsubSxAvroJsonTopic)
.choice().when().constant(!pubsubSxAvroJsonTopic.isEmpty())
.process(siriAvroJsonSerializer)
.to(pubsubSxAvroJsonTopic)
.endChoice()
.routeId("anshar.pubsub.sx.producer.avro.json");
} else {
log.info("Publish Avro-SX to pubsub disabled");
Expand Down

0 comments on commit 2b15976

Please sign in to comment.