Tag: eai

在Apache Camel应用程序中,unit testing如何注入模拟端点来代替真实端点?

我正在使用Apache Camel实现消息转换器模式 ,以使用来自RESTful端点的消息并将它们发送到AMQP端点。 封闭的应用程序基于Spring Boot,因此我使用Camel的“ spring-boot ”组件来集成这两个框架。 正如这个spring-boot链接中的文档所示,我在@Configuration -annotated类中实现了我的Camel路由,该类扩展了RouteBuilder : @Component public class MyRestToAmqpRouter extends RouteBuilder { @Override public void configure() throws Exception { from(“jetty:http://my-restful-url”) .process(exchange -> { // convert the message body from JSON to XML, take some // incoming header values and put them in the outgoing // body, etc… }).to(“rabbitmq://my-rabbitmq-url”); } } […]