diff --git a/core/src/main/java/org/apache/camel/kafkaconnector/utils/CamelKafkaConnectMain.java b/core/src/main/java/org/apache/camel/kafkaconnector/utils/CamelKafkaConnectMain.java index 78bbeefd8b..f973e34639 100644 --- a/core/src/main/java/org/apache/camel/kafkaconnector/utils/CamelKafkaConnectMain.java +++ b/core/src/main/java/org/apache/camel/kafkaconnector/utils/CamelKafkaConnectMain.java @@ -47,6 +47,8 @@ public class CamelKafkaConnectMain extends SimpleMain { public static final String KAMELET_IDEMPOTENT_TEMPLATE_PARAMETERS_PREFIX = "camel.kamelet.ckcIdempotent."; public static final String KAMELET_REMOVEHEADER_TEMPLATE_PARAMETERS_PREFIX = "camel.kamelet.ckcRemoveHeader."; + private static final String CAMEL_PROPERTY_PREFIX = "camel."; + private static final Logger LOG = LoggerFactory.getLogger(CamelKafkaConnectMain.class); protected volatile ConsumerTemplate consumerTemplate; @@ -227,7 +229,10 @@ public CamelKafkaConnectMain build(CamelContext camelContext) { camelMain.configure().setDumpRoutes(Boolean.TRUE.toString()); Properties camelProperties = new Properties(); - camelProperties.putAll(props); + Map camelProps = props.entrySet().stream() + .filter(entry -> entry.getKey().startsWith(CAMEL_PROPERTY_PREFIX)) + .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue)); + camelProperties.putAll(camelProps); //error handler camelMain.getCamelContext().getRegistry().bind("ckcErrorHandler", new DefaultErrorHandlerBuilder());