89.11. Spring Boot Auto-Configuration
当在 Spring Boot 中使用 jsonpath 时,请确保使用以下 Maven 依赖项来支持自动配置:
<dependency> <groupId>org.apache.camel.springboot</groupId> <artifactId>camel-jsonpath-starter</artifactId> </dependency>
组件支持 8 个选项,如下所列。
Name | 描述 | 默认值 | 类型 |
---|---|---|---|
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 字符串值,而不是 Map/POJO 值。 | false | 布尔值 |