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

Java 8 DSL : add support for Suppliers

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: camel-core, eip
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      One of the things that was missing in previous Java 8 DSL improvement rounds was the possibility to use Suppliers to provides objects to the routes.

      As today:

          from("direct:start")
              .idempotentConsumer()
                  .header("messageId")
                  .messageIdRepository(createRepo())
              .to("mock:result");
      

      With suppliers:

          from("direct:start")
              .idempotentConsumer()
                  .header("messageId")
                  .messageIdRepository(this::createRepo)
              .to("mock:result");
      

      Adding that does not result in such a big improvement for the DSL but it adds some overhead to the underlying definitions as we may need to add additional variables to hold the suppliers and other stuffs to convert suppliers i.e. to expression clause so we should have a look at this issue in Camel 3.0 (where we may have the chance to do a deeper refactor and suppliers may play better).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                lb Luca Burgazzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: