How to set map in Camel kafka option params

21 views Asked by At

We have property called additional properties in camel kafka options which is of type map

 return "kafka:" + topic + "?brokers= " + host + "&groupId=" + group + "&securityProtocol=SASL_SSL"
                + "&saslJaasConfig=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required;"
                + "&saslMechanism=OAUTHBEARER"
                + "&sslTruststorePassword=changeit"
                + "&additionalProperties=AuthProvider"
                + "&sslTruststoreLocation=" + "truststore.jks"

Expected is map type & since we are building it with string uri then how can we pass map in above camel kafka option paramters.

enter image description here

1

There are 1 answers

0
James Netherton On

The Camel Kafka component documentation gives an example of how to configure additionalProperties:

https://camel.apache.org/components/4.4.x/kafka-component.html#_endpoint_query_option_additionalProperties

You prefix each option with additionalProperties. followed by the name of the Kafka property you want to configure. For example.

from("kafka:myTopic?additionalProperties.transactional.id=12345&additionalProperties.schema.registry.url=http://localhost:8811/avro")