Skip to content

Instantly share code, notes, and snippets.

@dineshbhagat
Last active July 10, 2019 16:18
Show Gist options
  • Save dineshbhagat/80c3df8f37546bf6e341db7f74be27d9 to your computer and use it in GitHub Desktop.
Save dineshbhagat/80c3df8f37546bf6e341db7f74be27d9 to your computer and use it in GitHub Desktop.
apache-camel-url pattern for version higher and lesser than 2.22.0

apache-camel-kafka version >= 2.22

# consumer URL, should be in one line, for readability added new lines
kafka.url=kafka://
${kafka.topic}
?
brokers=${kafka.broker}&
&groupId=${kafka.groupId}
serializerClass=org.apache.kafka.common.serialization.StringSerializer&
keySerializerClass=org.apache.kafka.common.serialization.StringSerializer&
securityProtocol=${securityProtocol}&
sslKeystoreLocation=${keystore-path}&
sslKeystorePassword=${keystore-password}&
sslTruststoreLocation=${trust-store-path}&
sslTruststorePassword=${secrete-password-for-truststore}


# if you do not need to verify brocker url has https or not then need to add following property along with other 
sslEndpointAlgorithm=null

# If the option is true, then KafkaProducer will ignore the KafkaConstants.TOPIC header setting of the inbound message.
# if your old topics have messages with headers like 
exchange.getIn().setHeader(KafkaConstants.PARTITION_KEY, "myKey");
# then you need to set following property for producer
# producer url
bridgeEndpoint=true

# Pattern:
kafka://<topic> ? brokers=<brokers>
# if multiple topics, add it as comma separated
topic1,topic2,topic3

apache-camel-kafka version < 2.22

kafka.url=kafka:${kafka.broker}
?
topic=${kafka.topic}&
keySerializerClass=org.apache.kafka.common.serialization.StringSerializer&
serializerClass=org.apache.kafka.common.serialization.StringSerializer&
requestTimeoutMs=600000&
requestRequiredAcks=1&
lingerMs=10000&
securityProtocol=SSL&
sslKeystoreLocation=${keystore-path}&
sslKeystorePassword=${keystore-password}&
sslTruststoreLocation=${trust-store-path}&
sslTruststorePassword=${secrete-password-for-truststore}

# Pattern:

kafka:brokers=<brokers> ? topic = <topic> 
brockers can be <hosturl:port> or <ip-address:port>, comma seperated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment