Hi Earlier, I was about to update the kafka component manually after it was initialized by springboot. Now that is not happening. Springboot is updating kafka component after my updates. As a workaround I am not using kafka springboot boot and only using plain camel kafka component.
But the question still remains, how to update springboot component using our custom code before starting camel routes. Thanks and Regards, Hemang Ajmera -----Original Message----- From: Mark Nuttall <mknutt...@gmail.com> Sent: 16 July 2021 20:08 To: users@camel.apache.org Subject: Re: Springboot creating new Kakfa components EXTERNAL SENDER: Do not click any links or open any attachments unless you trust the sender and know the content is safe. EXPÉDITEUR EXTERNE: Ne cliquez sur aucun lien et n’ouvrez aucune pièce jointe à moins qu’ils ne proviennent d’un expéditeur fiable, ou que vous ayez l'assurance que le contenu provient d'une source sûre. Fyi, using Spring Boot and/or Camel, you can and should specify kafka properties in property / yaml files. You dont need to create a Kafka Component. Spring/Camel will do that for you. That is what they do. That way it will be configured correctly. https://urldefense.com/v3/__https://docs.spring.io/spring-boot/docs/current/reference/html/application-properties.html*application-properties.integration__;Iw!!AaIhyw!8qQFRYs8bIDrDZgwoMSFfS39IinvKmF7nHY6RJqTjM1Q43bmugjiG2DOFIoCNire$ https://urldefense.com/v3/__https://camel.apache.org/camel-spring-boot/3.7.x/kafka-starter.html__;!!AaIhyw!8qQFRYs8bIDrDZgwoMSFfS39IinvKmF7nHY6RJqTjM1Q43bmugjiG2DOFERkYOX3$ On Thu, Jul 15, 2021 at 11:10 AM Ajmera, Hemang C <hemang.ajm...@cgi.com> wrote: > Hi > > I am configuring kafka component using some default values > configured via springboot configurations. This code works fine for > camel 3.4.5, however it is not working with camel 3.11.0. I checked > the migration documents, but didn’t find anything significant. When I > check the output, kakfa is configured with default values and not with what I > am providing. > Here is the code which is used for configuration kafka component > > > > @Configuration > > @EnableConfigurationProperties(KafkaComponentProperties.class) > > public class KafkaComponentFactory { > > > > @Autowired(required = false) > > KafkaComponentProperties kafkaProp; > > > > @Bean("kafka") > > public KafkaComponent createKafkaComponent() throws KafkaException > { > > > > KafkaComponent kafka = new KafkaComponent(); > > KafkaConfiguration kafkaConfiguration = new > KafkaConfiguration(); > > > > > kafkaConfiguration.setSaslMechanism(kafkaProp.getSaslMechanism()); > > > > kafkaConfiguration.setSecurityProtocol(kafkaProp.getSecurityProtocol() > ); > > kafkaConfiguration.setGroupId(kafkaProp.getGroupId()); > > kafkaConfiguration.setBrokers(kafkaProp.getBrokers()); > > > kafkaConfiguration.setSslTruststorePassword(kafkaProp.getSslTruststore > Password()); > > > kafkaConfiguration.setSslKeystorePassword(kafkaProp.getSslKeystorePass > word()); > > > kafkaConfiguration.setSslTruststoreLocation(kafkaProp.getSslTruststore > Location()); > > > kafkaConfiguration.setSslKeystoreLocation(kafkaProp.getSslKeystoreLoca > tion()); > > > kafkaConfiguration.setAutoCommitEnable(kafkaProp.getAutoCommitEnable() > ); > > > kafkaConfiguration.setAllowManualCommit(kafkaProp.getAllowManualCommit > ()); > > > kafkaConfiguration.setSslEndpointAlgorithm(kafkaProp.getSslEndpointAlg > orithm()); > > > > kafka.setConfiguration(kafkaConfiguration); > > > > System.setProperty("java.security.auth.login.config", > kafkaProp.getKafkaClientConfigFilePath()); > > > > return kafka; > > > > } > > > > > > > > Thanks and Regards, > > Hemang Ajmera > > > > *Hemang C Ajmera* | Technical Architect > > Asia Pacific Communications, Media and Utilities Delivery Center | CGI > > Block 5, DLF-SEZ, Manapakkam, Chennai – 600089, India > O: +91-44-6647-3828 | M: +91-89397-07557 | M: +91-98841-66619 | VOIP: > 8083828 > > hemang.ajm...@cgi.com | http://www.cgi.com > > [image: Description: Description: Description: Description: Description: > Description: Description: > C:\Users\rahul.muthalali\AppData\Local\Microsoft\Windows\Temporary > Internet Files\Content.Word\Top_Employer_India_English_2016.gif] > > >