davsclaus commented on issue #21:
URL: 
https://github.com/apache/camel-kamelets-examples/issues/21#issuecomment-1562486284

   I have a fix in the works, and created a ticket to fix this in camel-kakfa 
component
   https://issues.apache.org/jira/browse/CAMEL-19387
   
   Your example can now run with the fix and I can use this syntax
   ```
   # camel-k: dependency=mvn:com.azure:azure-identity:1.9.0
   # camel-k: 
dependency=mvn:com.microsoft.azure:azure-schemaregistry-kafka-avro:1.1.1
   
   - beans:
     - name: defaultAzureCredential
       #type: "#class:my.custom.azure.credential.SimpleCredential"
       type: "#class:com.foo.acme.MyCredential"
       properties:
         username: "scott"
   
   - route:
       id: "kafka-to-mq"
       from:
         uri: "kafka:cheese"
         parameters:
           brokers: "localhost:1234"
           consumerRequestTimeoutMs: "1234"
           valueDeserializer: 
'com.microsoft.azure.schemaregistry.kafka.avro.KafkaAvroDeserializer'
           additionalProperties.schema.registry.url: 
'https://mykafka.servicebus.windows.net'
           additionalProperties.schema.registry.credential: 
'#bean:defaultAzureCredential'
         steps:
           - to: "log:foo"
   ```
   
   And I implemented a custom bean
   ```
   package com.foo.acme;
   
   import com.azure.core.credential.AccessToken;
   import com.azure.core.credential.TokenCredential;
   import com.azure.core.credential.TokenRequestContext;
   import reactor.core.publisher.Mono;
   
   public class MyCredential implements TokenCredential {
   
       private String username;
   
       public String getUsername() {
           return username;
       }
   
       public void setUsername(String username) {
           this.username = username;
       }
   
       @Override
       public Mono<AccessToken> getToken(TokenRequestContext 
tokenRequestContext) {
           return null;
       }
   
       @Override
       public AccessToken getTokenSync(TokenRequestContext request) {
           return TokenCredential.super.getTokenSync(request);
       }
   }
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to