Skip to content

Commit

Permalink
fix(docker): start issue when there are multiple kafka brokers in boo…
Browse files Browse the repository at this point in the history
…tstrap config (#2231)
  • Loading branch information
Dexter Lee authored Mar 12, 2021
1 parent 81fa8d6 commit 8d731b5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker/datahub-gms/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fi

dockerize \
-wait tcp://$EBEAN_DATASOURCE_HOST \
-wait tcp://$KAFKA_BOOTSTRAP_SERVER \
-wait tcp://$(echo $KAFKA_BOOTSTRAP_SERVER | sed 's/,/ -wait tcp:\/\//g') \
-wait http://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT \
-wait $NEO4J_HOST \
-timeout 240s \
Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-mae-consumer/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if ! echo $NEO4J_HOST | grep -q "://" ; then
fi

dockerize \
-wait tcp://$KAFKA_BOOTSTRAP_SERVER \
-wait tcp://$(echo $KAFKA_BOOTSTRAP_SERVER | sed 's/,/ -wait tcp:\/\//g') \
-wait http://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT \
-wait $NEO4J_HOST \
-timeout 240s \
Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-mce-consumer/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

# -wait tcp://GMS_HOST:$GMS_PORT \
dockerize \
-wait tcp://$KAFKA_BOOTSTRAP_SERVER \
-wait tcp://$(echo $KAFKA_BOOTSTRAP_SERVER | sed 's/,/ -wait tcp:\/\//g') \
-timeout 240s \
java -jar /datahub/datahub-mce-consumer/bin/mce-consumer-job.jar
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import io.confluent.kafka.serializers.AbstractKafkaAvroSerDeConfig;
import io.confluent.kafka.serializers.KafkaAvroDeserializer;
import java.time.Duration;
import java.util.Arrays;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.avro.generic.GenericRecord;
Expand Down Expand Up @@ -40,7 +41,7 @@ public KafkaListenerContainerFactory<?> kafkaListenerContainerFactory(KafkaPrope

// KAFKA_BOOTSTRAP_SERVER has precedence over SPRING_KAFKA_BOOTSTRAP_SERVERS
if (kafkaBootstrapServer != null && kafkaBootstrapServer.length() > 0) {
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaBootstrapServer);
props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, Arrays.asList(kafkaBootstrapServer.split(",")));
} // else we rely on KafkaProperties which defaults to localhost:9092

props.put(AbstractKafkaAvroSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG, kafkaSchemaRegistryUrl);
Expand Down

0 comments on commit 8d731b5

Please sign in to comment.