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

Add default no-op implementation of RouteBuilder

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • 4.0.0
    • camel-core
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: