Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-12608

Add default no-op implementation of RouteBuilder

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Inspired by JMockit which use object initializers for introducing their Java DSL, I think it would be a good idea to add a no-op default implementation of RouteBuilder, with a short name like 'Routes'.

      ctx.add(new Routes {{
            from("file:data/inbox?noop=true")
              .to("file:data/outbox");
      }});
      

      That way one can avoid the creation of anonymous inner classes, which is not only shorted and less boilerplate but also creates less classes and saves non-heap memory.

       

      A simple POC as submitted as PR at https://github.com/apache/camel/pull/2401 which could be extended to include better unit testing and documentation.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rhuss Roland Huss
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: