第 332 章 字符串模板组件

可作为 Camel 版本 1.2 提供

string-template: 组件允许您使用 String Template 来处理消息。这在使用 Templating 生成请求的响应时是理想的选择。

Maven 用户需要将以下依赖项添加到其 pom.xml 中:

<dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-stringtemplate</artifactId>
    <version>x.x.x</version>
    <!-- use the same version as your Camel core version -->
</dependency>

332.1. URI 格式

string-template:templateName[?options]

其中 templateName 是要调用的模板的 classpath-local URI;或者,也可以是远程模板的完整 URL。

您可以使用以下格式在 URI 中附加查询选项 ?option=value&option=value&…​