使用Apache Camel 2.9.1
我如何对下面这样的东西进行单元测试?
public class MyRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
from("timer.something?delay=0?repeatCount=1")
// do some stuff
.to("{{some.endpoint}}")
.e
我刚接触过骆驼,尝试过多次尝试,却找不到解决办法。
我已经配置了七条路由,当我的服务启动时,这些路由看起来是正确启动的。
DefaultCamelContext INFO Total 7 routes, of which 7 are started
DefaultCamelContext INFO Apache Camel 2.20.2 ...
但是,当我沿着其中一条路由发送消息时,它会由于一个DataFormatter处理器而到达marshal(),在这里抛出一个NullPointerException。
如果我深入研究这一点,问题似乎与Exc
我正致力于在一个文件夹上创建一个自动轮询,我的路由是在spring XML文件中设置的,我如何才能保持应用程序在该文件夹上运行和轮询,我可以使用常规路由在java中输入它们作为from to,但现在由于使用XML route spring,我无法创建路由构建器或添加一个。我的主线是
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.apache.camel.main.Main;
public class FileTransferinSpring {
public
我在做这样的事
from(rabbitmq:pollingQueue?prefetchSize=1&concurrentConsumer=10)
.process(pollingRequestStatus) // check status of the request, if not ready, requeue = true
.Choice
.when(requeue == true) // request not ready
.to(rabbitmq:pollingQueue)//back to the
我是Apache Camel的新手。我正在尝试在Apache Camel中将报头与请求正文一起发送到路由。
// headers is a map
APIResponse response = (APIResponse) producer.requestBodyAndHeader("direct:route1",body,headers);
我收到以下错误:
java.lang.IllegalArgumentException: defaultEndpoint must be specified
at org.apache.camel.util.ObjectHelper
我的问题是,我必须将exchange正文值(在前一个路由中设置)传递到.to("rest:get ...")步骤中。我正在尝试类似于下面的代码,但是类变量id在重要的一步中等于null,尽管我在一个自定义处理器中设置了它的值。我也尝试过使用simple()函数,它可以计算成exchange,但问题是,在.to("rest:get ...")方法中,我不能访问exchange,只能在处理器中访问它。
如何将交换体值传递到.to("rest:get ...")步骤?
public class SomeRoute extends RouteBuilde
我需要能够轮询Rest WebService,并作为调用的一部分传入来自WebService的最后一个响应的id。我知道要在Camel中使用动态端点,您需要使用丰富的处理器,但我无法进行更新。
请考虑下面这个简单的案例:
public class MyRoute extends RouteBuilder {
long id;
@Override
public void configure() throws Exception {
from("timer://foo?fixedRate=true&period=3000")
.enri
我的Camel Blueprint测试失败,出现以下异常:
org.osgi.framework.BundleException: Unable to start bundle
at org.apache.felix.connect.PojoSRBundle.start(PojoSRBundle.java:163)
at org.apache.felix.connect.PojoSR.startBundles(PojoSR.java:304)
at org.apache.felix.connect.