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

create a java8 only demo showing how to use lambda expressions for Predicate / Expression inside the Java DSL (using Message as a typesafe parameter)

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.18.0
    • Component/s: examples
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      e.g. so folks can type things like

      from("seda:cheese").
        filter(m -> m.getHeader("foo", int.class) > 5).
        map(m -> createPurchaseOrder(m.getBody(Invoice.class)).
        to("seda:bar");
      

      Note if the current Predicate/Expression classes don't work as lambdas we could add a new interface with a single method to the DSL to ensure Java 8 does the right thing with lambdas

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lb Luca Burgazzoli
                Reporter:
                jstrachan James Strachan
              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: