74.11. Spring Boot Auto-Configuration
当将 jsonpath 与 Spring Boot 搭配使用时,请确保使用以下 Maven 依赖项来支持自动配置:
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-jsonpath-starter</artifactId> </dependency>
<dependency>
<groupId>org.apache.camel.springboot</groupId>
<artifactId>camel-jsonpath-starter</artifactId>
</dependency>
组件支持 8 个选项,如下所列。
名称 | 描述 | 默认 | 类型 |
---|---|---|---|
camel.language.jsonpath.allow-easy-predicate | 是否允许使用简单的 predicate 解析器来预解析 predicates。 | true | 布尔值 |
camel.language.jsonpath.allow-simple | 是否在 JSONPath 表达式中允许内联简单异常。 | true | 布尔值 |
camel.language.jsonpath.enabled | 是否启用 jsonpath 语言的自动配置。这默认是启用的。 | 布尔值 | |
camel.language.jsonpath.header-name | 用作输入的标头名称,而不是邮件正文。 | 字符串 | |
camel.language.jsonpath.option | 要在 JSONPath 中配置附加选项。可以使用逗号分隔多个值。 | 字符串 | |
camel.language.jsonpath.suppress-exceptions | 是否抑制异常,如 PathNotFoundException。 | false | 布尔值 |
camel.language.jsonpath.trim | 是否修剪值以移除前导和尾随空格和换行符。 | true | 布尔值 |
camel.language.jsonpath.write-as-string | 是否将每行/元素的输出写为 JSON String 值,而不是映射/POJO 值。 | false | 布尔值 |