Skip to content
Permalink
Browse files
Related to #423 resolved a problem with marshal/unmarshal after fixin h…
  • Loading branch information
valdar committed Oct 25, 2021
1 parent a7437ad commit aa3254ae219c53abf774e4c3183fcf73f8d5b246
Showing 2 changed files with 14 additions and 20 deletions.
@@ -228,16 +228,15 @@ public CamelKafkaConnectMain build(CamelContext camelContext) {
Properties camelProperties = new Properties();
camelProperties.putAll(props);

//TODO: enable or delete these parameters once https://issues.apache.org/jira/browse/CAMEL-16551 is resolved
// //dataformats
// if (!ObjectHelper.isEmpty(marshallDataFormat)) {
// camelProperties.put(CamelSourceTask.KAMELET_SOURCE_TEMPLETE_PARAMETERS_PREFIX + "marshall", marshallDataFormat);
// camelProperties.put(CamelSinkTask.KAMELET_SINK_TEMPLATE_PARAMETERS_PREFIX + "marshall", marshallDataFormat);
// }
// if (!ObjectHelper.isEmpty(unmarshallDataFormat)) {
// camelProperties.put(CamelSourceTask.KAMELET_SOURCE_TEMPLETE_PARAMETERS_PREFIX + "unmarshall", unmarshallDataFormat);
// camelProperties.put(CamelSinkTask.KAMELET_SINK_TEMPLATE_PARAMETERS_PREFIX + "unmarshall", unmarshallDataFormat);
// }
//dataformats
if (!ObjectHelper.isEmpty(marshallDataFormat)) {
camelProperties.put(CamelSourceTask.KAMELET_SOURCE_TEMPLATE_PARAMETERS_PREFIX + "marshall", marshallDataFormat);
camelProperties.put(CamelSinkTask.KAMELET_SINK_TEMPLATE_PARAMETERS_PREFIX + "marshall", marshallDataFormat);
}
if (!ObjectHelper.isEmpty(unmarshallDataFormat)) {
camelProperties.put(CamelSourceTask.KAMELET_SOURCE_TEMPLATE_PARAMETERS_PREFIX + "unmarshall", unmarshallDataFormat);
camelProperties.put(CamelSinkTask.KAMELET_SINK_TEMPLATE_PARAMETERS_PREFIX + "unmarshall", unmarshallDataFormat);
}

//aggregator
if (!ObjectHelper.isEmpty(aggregationSize)) {
@@ -310,9 +309,9 @@ public void configure() {
RouteTemplateDefinition rtdSource = routeTemplate("ckcSource")
.templateParameter("fromUrl")
.templateParameter("errorHandler", "ckcErrorHandler")
//TODO: enable or delete these parameters once https://issues.apache.org/jira/browse/CAMEL-16551 is resolved
// .templateParameter("marshall", "dummyDataformat")
// .templateParameter("unmarshall", "dummyDataformat")

.templateParameter("marshall", "dummyDataformat")
.templateParameter("unmarshall", "dummyDataformat")

//TODO: change CamelConnectorConfig.CAMEL_CONNECTOR_AGGREGATE_NA to ckcAggregationStrategy?
.templateParameter("aggregationStrategy", CamelConnectorConfig.CAMEL_CONNECTOR_AGGREGATE_NAME)
@@ -327,10 +326,10 @@ public void configure() {
ProcessorDefinition<?> rdInTemplateSource = rtdSource.from("{{fromUrl}}")
.errorHandler(new ErrorHandlerBuilderRef("{{errorHandler}}"));
if (!ObjectHelper.isEmpty(marshallDataFormat)) {
rdInTemplateSource = rdInTemplateSource.marshal(marshallDataFormat);
rdInTemplateSource = rdInTemplateSource.marshal("{{marshall}}");
}
if (!ObjectHelper.isEmpty(unmarshallDataFormat)) {
rdInTemplateSource = rdInTemplateSource.unmarshal(unmarshallDataFormat);
rdInTemplateSource = rdInTemplateSource.unmarshal("{{unmarshall}}");
}

if (getContext().getRegistry().lookupByName("aggregate") != null) {
@@ -235,9 +235,6 @@ public void testUrlPrecedenceOnComponentProperty() throws InterruptedException {
CamelSourceTask sourceTask = new CamelSourceTask();
sourceTask.start(props);

// assertEquals(4, sourceTask.getCms().getCamelContext().getEndpoints().size());


sourceTask.getCms().getCamelContext().getEndpoints().stream()
.filter(e -> e.getEndpointUri().startsWith("timer"))
.forEach(e -> {
@@ -261,8 +258,6 @@ public void testSourcePollingConsumerOptions() {
CamelSourceTask sourceTask = new CamelSourceTask();
sourceTask.start(props);

// assertEquals(4, sourceTask.getCms().getCamelContext().getEndpoints().size());

sourceTask.getCms().getCamelContext().getEndpoints().stream()
.filter(e -> e.getEndpointUri().startsWith("seda"))
.forEach(e -> {

0 comments on commit aa3254a

Please sign in to comment.