java 骆驼_没有明显原因的骆驼停止

我有一个bean生成器和一个bean使用者,在一个路由中使用 . 生产环境 者通过一个线程生成并监听一个hazelcast队列上的数据(它可能是其他任何东西,甚至是本地随机生成的数据我相信) .

数据被发送到seda endpoints ,以确保并发 . 消费者获取数据并将其转发到另一个hazelcast队列 . 但它又可能是其他任何东西 .

它运作良好,但过了一会儿,Camel关闭了,我找不到原因 .

以下是我看到的一些消息:

处理大量数据......

[ main] MainSupport INFO Apache Camel 2.10.3 stopping

[ main] DefaultCamelContext INFO Apache Camel 2.10.3 (CamelContext: camel-1) is shutting down

[ main] DefaultShutdownStrategy INFO Starting to graceful shutdown 1 routes (timeout 300 seconds)

[el-1) thread #2 - ShutdownTask] DefaultShutdownStrategy INFO Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 300 seconds.

然后在300秒内处理并停止 .

这里有一些代码:

制片人:

public void run()

{

try

{

IRequest service = ProxyHelper.createProxy(context.getEndpoint("seda:echo"), IRequest.class);

BlockingQueue q = client.getQueue(MainApp.sQueueReceive);

while(true)

{

Request request;

request = q.take();

// no response awaited

service.request(request);

}

}

消费者:

public void onMessage(Request request)

{

nb_forwarded++;

BlockingQueue q = MainApp.client.getQueue(MainApp.sQueueForward);

try

{

q.put(request);

}

catch (InterruptedException e)

{

exit(2); --> it does not happen

}

最后,路线:

from("seda:echo")

.setExchangePattern(ExchangePattern.InOnly)

.bean(new HazelcastForwarder(), "onMessage");

它在InOnly,因为没有人等待制作人的回应,它只是一个前锋 .

那么为什么Camel会停下来呢 . 那些说它正在停止的人没有消息 . Camel中是否存在此类默认行为 . 在哪些情况下?

谢谢!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值