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 2022/10/26 10:31:08 UTC

[GitHub] [camel] essobedo opened a new pull request, #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

essobedo opened a new pull request, #8626:
URL: https://github.com/apache/camel/pull/8626

   Fix for https://issues.apache.org/jira/browse/CAMEL-17505
   
   ## Motivation
   
   For Java DSL then we have a data format builder at `org.apache.camel.builder.DataFormatClause`
   
   This class is very verbose as for Java DSL we have overloaded methods to set the various options, but it can get too far like `xmlSecurity` with 15 methods.
   
   Instead, we should propose a builder DSL class that the `DataFormatClause` can provide.
   
   ## Modifications:
   
   * Add a static nested class `Builder` to all existing data formats
   * Add a factory for the builder of all the data formats `DataFormatBuilderFactory`
   * Add the method `dataFormat()` to the `RouteBuilder` to give access to the factory of builders while defining the routes.
   * Call explicitly the default constructor from all constructors of each data format when not already done to ensure that the data format name is properly set (not related to the initial issue) 


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292439716

   Very good docs. However the DataFormat DSL only applies to Java DSL (or other programming languages on top of Java).
   
   In XML or YAML DSL, all the data formats can be fully configured.


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292185576

   @davsclaus 
   
   With this route:
   ```
   from("direct:format")
       .setBody(constant(Map.of("foo", "abc", "bar", 123)))
       .marshal(dataFormat().csv().delimiter(";").end());
   ```
   And `camel.main.dump-routes=true` in `application.properties`, I get the following log message:
   
   ```
   <routes xmlns="http://camel.apache.org/schema/spring">
   
       <route id="route1">
           <from uri="direct:format"/>
           <setBody id="setBody1">
               <expressionDefinition>{foo=abc, bar=123}</expressionDefinition>
           </setBody>
           <marshal id="marshal1">
               <csv delimiter=";" formatName="DEFAULT"/>
           </marshal>
       </route>
   
   </routes>
   ```
   Seems to be correct, right?
   


-- 
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] github-actions[bot] commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292386161

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 11 | 11 | 1 | 11 |


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292148125

   > Is the builder _hand coded_ ?
   
   @davsclaus yes


-- 
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] github-actions[bot] commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1291829631

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
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] github-actions[bot] commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292346195

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 3 | 3 | 1 | 3 |


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292186419

   Maybe we could add a page DataFormat DSL a bit like endpoint dsl


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292186995

   yes correct 


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292136593

   Is the builder _hand coded_ ? 


-- 
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] github-actions[bot] commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1293180952

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 11 | 11 | 2 | 10 |


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292160117

   This is great work - it was a big task to create all these builder methods for all the options for every data format.
   Since the builder are in the model then we remember to update them when we add a new option etc on an existing data format.
   


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1293001701

   So, you would like me to add a note indicating that is for Java only?


-- 
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] github-actions[bot] commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292359942

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 11 | 11 | 1 | 11 |


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1293096655

   > Yes, and in fact we may do the same for Endpoint DSL and Component DSL
   
   WDYT of "The Data Format DSL is exclusively available as part of the Java DSL."?


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292645296

   TBH, I don't really get your last remark, what do you expect exactly?


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292133411

   @essobedo can you check if the route dump with this new builder outputs the XML with the dataformat and its values configured correctly.
   
   Sometimes when using Java DSL then XML dump cannot generate 100% everything correctly.
   
   You can do this in the JMX tests in camel-management. There are some existing tests.
   
   If you run with jbang / camel-main, you can easily also use
   
   --prop=camel.main.dump-routes=true
   
   


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292163549

   I wondering where I can add some doc about it, any idea?


-- 
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] github-actions[bot] commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1291913983

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 3 | 3 | 1 | 3 |


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292264266

   I have just added [some doc about it](https://github.com/apache/camel/pull/8626/commits/15fbc2ad974b52e0d1515aaf24b9ee1bb77b9083)


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292972416

   I was trying to say that this is only for Java DSL


-- 
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] essobedo merged pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo merged PR #8626:
URL: https://github.com/apache/camel/pull/8626


-- 
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] essobedo commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
essobedo commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1292022775

   The build fails because of some flaky tests that are not related to these changes:
   
   ```
   [INFO] Results:
   [INFO] 
   [ERROR] Failures: 
   [ERROR] org.apache.camel.component.file.FileConsumerResumeStrategyTest.testResume
   [ERROR]   Run 1: FileConsumerResumeStrategyTest.testResume:79->ContextTestSupport.assertMockEndpointsSatisfied:376 mock://result Received message count. Expected: <4> but was: <7>
   [ERROR]   Run 2: FileConsumerResumeStrategyTest.testResume:79->ContextTestSupport.assertMockEndpointsSatisfied:376 mock://result Received message count. Expected: <4> but was: <6>
   [ERROR]   Run 3: FileConsumerResumeStrategyTest.testResume:79->ContextTestSupport.assertMockEndpointsSatisfied:376 mock://result Received message count. Expected: <4> but was: <7>
   [INFO] 
   [WARNING] Flakes: 
   [WARNING] org.apache.camel.impl.LimitedPollingConsumerPollStrategyTest.testTwoConsumersLimitedPollingConsumerPollStrategy
   [ERROR]   Run 1: LimitedPollingConsumerPollStrategyTest.testTwoConsumersLimitedPollingConsumerPollStrategy:164 Should still be started ==> expected: <true> but was: <false>
   [INFO]   Run 2: PASS
   [INFO] 
   [WARNING] org.apache.camel.processor.RedeliveryDeadLetterErrorHandlerNoRedeliveryOnShutdownTest.testRedeliveryErrorHandlerNoRedeliveryOnShutdown
   [ERROR]   Run 1: RedeliveryDeadLetterErrorHandlerNoRedeliveryOnShutdownTest.testRedeliveryErrorHandlerNoRedeliveryOnShutdown:58 Redelivery counter should be >= 20 and < 100, was: 16 ==> expected: <true> but was: <false>
   [INFO]   Run 2: PASS
   [INFO] 
   [WARNING] org.apache.camel.processor.aggregator.AggregateProcessorTest.testAggregateProcessorCompletionTimeout
   [ERROR]   Run 1: AggregateProcessorTest.testAggregateProcessorCompletionTimeout mock://result Body of message: 0. Expected: <A+B+C> but was: <A+B+C+D>
   [INFO]   Run 2: PASS
   [INFO] 
   [WARNING] org.apache.camel.processor.async.AsyncProcessorAwaitManagerInterruptWithRedeliveryTest.testAsyncAwaitInterrupt
   [ERROR]   Run 1: AsyncProcessorAwaitManagerInterruptWithRedeliveryTest.testAsyncAwaitInterrupt:65 Should throw exception
   [INFO]   Run 2: PASS
   [INFO] 
   [WARNING] org.apache.camel.processor.enricher.PollEnrichFileCustomAggregationStrategyTest.testPollEnrichCustomAggregationStrategyBody
   [ERROR]   Run 1: PollEnrichFileCustomAggregationStrategyTest.testPollEnrichCustomAggregationStrategyBody mock://start Body of message: 0. Expected: <Start> but was: <>
   [INFO]   Run 2: PASS
   [INFO] 
   [WARNING] org.apache.camel.processor.enricher.PollEnrichFileDefaultAggregationStrategyTest.testPollEnrichDefaultAggregationStrategyBody
   [ERROR]   Run 1: PollEnrichFileDefaultAggregationStrategyTest.testPollEnrichDefaultAggregationStrategyBody mock://start Body of message: 0. Expected: <Start> but was: <>
   [INFO]   Run 2: PASS
   [INFO] 
   [WARNING] org.apache.camel.processor.resequencer.ResequencerBatchOrderTest.testResequencerBatch
   [ERROR]   Run 1: ResequencerBatchOrderTest.testResequencerBatch:44->testIteration:75 Line was 4132 ==> expected: <true> but was: <false>
   [INFO]   Run 2: PASS
   ```


-- 
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] davsclaus commented on pull request #8626: CAMEL-17505: camel-core - Propose a DSL for data formats

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #8626:
URL: https://github.com/apache/camel/pull/8626#issuecomment-1293008594

   Yes, and in fact we may do the same for Endpoint DSL and Component DSL


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