Questo contenuto non è disponibile nella lingua selezionata.
Chapter 83. YAML DSL
A YAML stack for parsing YAML route definitions
83.1. What’s inside Copia collegamentoCollegamento copiato negli appunti!
Please refer to the above link for usage and configuration details.
83.2. Maven coordinates Copia collegamentoCollegamento copiato negli appunti!
Create a new project with this extension on code.quarkus.redhat.com
Or add the coordinates to your existing project:
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-yaml-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-yaml-dsl</artifactId>
</dependency>
83.3. Usage Copia collegamentoCollegamento copiato negli appunti!
83.3.1. Native mode Copia collegamentoCollegamento copiato negli appunti!
The following constructs when defined within Camel YAML DSL markup, require you to register classes for reflection. Refer to the Native mode guide for details.
83.3.1.1. Bean definitions Copia collegamentoCollegamento copiato negli appunti!
The YAML DSL provides the capability to define beans as follows.
In this example, the GreetingBean class needs to be registered for reflection. This applies to any types that you refer to under the beans key in your YAML routes.
@RegisterForReflection
public class GreetingBean {
}
@RegisterForReflection
public class GreetingBean {
}
83.3.1.2. Exception handling Copia collegamentoCollegamento copiato negli appunti!
Camel provides various methods of handling exceptions. Some of these require that any exception classes referenced in their DSL definitions are registered for reflection.
on-exception
@RegisterForReflection
public class MyHandledException {
}
@RegisterForReflection
public class MyHandledException {
}
throw-exception
@RegisterForReflection
public class ForcedException {
}
@RegisterForReflection
public class ForcedException {
}
do-catch
@RegisterForReflection(targets = FileNotFoundException.class)
public class MyClass {
}
@RegisterForReflection(targets = FileNotFoundException.class)
public class MyClass {
}