joshdreagan commented on issue #7140:
URL: https://github.com/apache/camel-quarkus/issues/7140#issuecomment-2737373314

   To work around, I took all the logic out of the Kafka consumer route and set 
it's `autoStartup` with a property.
   
   ```
   
from("kafka:{{kafka.source.topic}}?brokers={{kafka.brokers}}&groupId={{kafka.source.groupId}}")
     .routeId("kafka-source").autoStartup("{{kafka.source.autoStart:true}}")
     .to("direct:route")
   ;
   ```
   
   And I set my Kafka producer endpoints to have the `lazyStartProducer=true` 
option.
   
   Then I put an "application.properties" in my "src/test/resources" folder 
with a value of `kafka.source.autoStart=false`. That way, when my JUnit test 
starts up, the Kafka client will not attempt to connect. Then I can advice my 
routes and produce messages directly to the "direct:route" for my test cases 
because that's where my actual logic starts.
   
   Kind of clunky, but it works. ¯\\_(ツ)\_/¯


-- 
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-unsubscr...@camel.apache.org

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

Reply via email to