You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/03/02 16:42:02 UTC

[GitHub] [camel-k] arthurdm opened a new issue #2085: More information needed about dependency resolution

arthurdm opened a new issue #2085:
URL: https://github.com/apache/camel-k/issues/2085


   This issue is about the [dependencies](https://camel.apache.org/camel-k/latest/configuration/dependencies.html) documentation page.  It feels like it does not provide the user with the scenarios where Camel K does **not** resolve dependencies and which dependencies I should add.
   
   Take this simple integration as example:
   
   ```
       @Override
       public void configure() throws Exception {
   
           //Receive a msg from the configured Kafka topic
           from("kafka:" + topic).to("direct:kafka_consumer");
           
           //Push the body of the msg into the configured URL (using the configured username/apiKey)
           //We're using the http component to accomplish the outgoing call
           from("direct:kafka_consumer")
               .log("Received body: ${body}")
               .process(this)
           .to(url +
               "?httpMethod=POST" +
               "&authMethod=Basic" +
               "&authUsername=" + username +
               "&authPassword=" + apiKey +
               "&authenticationPreemptive=true")
           .log("Response code: ${header.CamelHttpResponseCode}")
           .log("Response body: ${body}");
       }
   ```
   
   It's a basic Kafka -> Rest mapping.  The first few times this integration failed with messages that there was no Kafka component, so I eventually learned that my `kamel run` cmd needed to include `-d camel-kafka` in order to work.  Shouldn't Camel K have resolved that from the line `from("kafka:" + topic)`?  If not, it should be documented that if using Kafka the `-d camel-kafka` option needs to be specified.
   
   After that I spent a long time debugging why my Pod failed with a  `java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest` error.  I tried `-d camel-http` but no luck.  It was only after @davsclaus pointed out in a reply to my [chat question](https://camel.zulipchat.com/#narrow/stream/257299-camel-k/topic/HttpServlet/near/228321231) (thanks Claus 👍 ) that I was directed to add `-d camel-quarkus-http`.   From a Camel K documentation perspective, how is someone expected to know that?
   
   My proposal is for this issue to gather the 10 most commonly explicitly added dependencies and write them into the [dependencies page](https://camel.apache.org/camel-k/latest/configuration/dependencies.htm) with the context on when they should be used.
   
   Thoughts?   I think Kafka & HTTP/S are good candidates.


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] mmacphail commented on issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
mmacphail commented on issue #2085:
URL: https://github.com/apache/camel-k/issues/2085#issuecomment-903901327


   In the meantime, I managed to make it work.
   
   If you use the schema registry, first don't forget to add confluent registry as a maven repository installing kamel:
   ```
   kamel install --maven-repository https://packages.confluent.io/maven/@id=confluent
   ```
   
   Then run kafka using the `-d` flag like this:
   ```
   kamel run -t logging.level=DEBUG -d mvn:org.apache.camel:camel-kafka:3.11.1 -d mvn:io.confluent:kafka-avro-serializer:6.0.0 helloworld.groovy
   ```


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez closed issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
squakez closed issue #2085:
URL: https://github.com/apache/camel-k/issues/2085


   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] mmacphail commented on issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
mmacphail commented on issue #2085:
URL: https://github.com/apache/camel-k/issues/2085#issuecomment-903884913


   I ran into a similar problem. I was expected camel-kafka to be resolved automatically when reading the doc.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2085:
URL: https://github.com/apache/camel-k/issues/2085#issuecomment-903894769


   I think the problem is caused by the dynamic nature of these URIs. As they are composed by a variable part, then we're not able to determine exactly which is the dependency to load (the variable will be likely known at runtime). I will check to see if there is room for improvement and for sure update the documentation to let the user know what to expect.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez edited a comment on issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
squakez edited a comment on issue #2085:
URL: https://github.com/apache/camel-k/issues/2085#issuecomment-903903338


   > In the meantime, I managed to make it work.
   > 
   > If you use the schema registry, first don't forget to add confluent registry as a maven repository installing kamel:
   > 
   > ```
   > kamel install --maven-repository https://packages.confluent.io/maven/@id=confluent
   > ```
   > 
   > Then run kafka using the `-d` flag like this:
   > 
   > ```
   > kamel run -t logging.level=DEBUG -d mvn:org.apache.camel:camel-kafka:3.11.1 -d mvn:io.confluent:kafka-avro-serializer:6.0.0 helloworld.groovy
   > ```
   
   You may shortcut that with `-d camel-kafka` and you'll also get the exact version needed according your installation. Can you also confirm which is the route you're using please? is it a dynamic one such as `from("kafka" + variable)...`?


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2085:
URL: https://github.com/apache/camel-k/issues/2085#issuecomment-903903338


   > In the meantime, I managed to make it work.
   > 
   > If you use the schema registry, first don't forget to add confluent registry as a maven repository installing kamel:
   > 
   > ```
   > kamel install --maven-repository https://packages.confluent.io/maven/@id=confluent
   > ```
   > 
   > Then run kafka using the `-d` flag like this:
   > 
   > ```
   > kamel run -t logging.level=DEBUG -d mvn:org.apache.camel:camel-kafka:3.11.1 -d mvn:io.confluent:kafka-avro-serializer:6.0.0 helloworld.groovy
   > ```
   
   Thanks, can you confirm which is the route you're using please? is it a dynamic one such as `from("kafka" + variable)...`?


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] mmacphail commented on issue #2085: More information needed about dependency resolution

Posted by GitBox <gi...@apache.org>.
mmacphail commented on issue #2085:
URL: https://github.com/apache/camel-k/issues/2085#issuecomment-903909663


   Yes, see following file:
   
   ```
   def bootstrap = 'my-cluster-kafka-bootstrap.kafka:9092'
   def topic = 'sensor'
   def groupId = 'test-camel-k'
   def keyDeserializer = 'org.apache.kafka.common.serialization.StringDeserializer'
   def valueDeserializer = 'io.confluent.kafka.serializers.KafkaAvroDeserializer'
   def schemaRegistryURL = 'http://schema-registry-service.kafka:8081'
   
   def kafka = "kafka:${topic}?brokers=${bootstrap}&groupId=${groupId}&autoOffsetReset=earliest&keyDeserializer=${keyDeserializer}&valueDeserializer=${valueDeserializer}&schemaRegistryURL=${schemaRegistryURL}"
   
   from(kafka)
     .to('log:info')
   ```


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org