0 Comments

Apache Camel's YAML DSL examples are currently in some parts lacking when compared to Java and XML samples. One thing I was trying to figure out was how to configure error handler using YAML.

Here's an example for future reference:

- error-handler:
    dead-letter-channel:
      dead-letter-uri: "https://webhook.site/b7562774-4939-4e90-9337-5b9dd4d2ff1d"
      redelivery-policy:
        maximum-redeliveries: 3
- route:
    from:
      uri: timer:timer
      steps:
        - setBody:
            expression:
              groovy:
                expression: |-
                  def obj = [:]
                  obj.FirstName = "M"
                  obj.LastName = "K"

                  result = obj

                  return result
        - marshal:
            json:
              library: jackson
              prettyPrint: true
        - to:
            uri: https://webhook.sitessss/b7562774-4939-4e90-9337-5b9dd4d2ff1d