骆驼是否为每个路由线程 [英] Does camel create a thread for each route

查看:203
本文介绍了骆驼是否为每个路由线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我一直在使用骆驼开始,我看到它潜在地解决了很多我的集成层的需求。

Recently i have started using camel and i see that it potentially addresses a lot of my integration layer needs.

我创建了一个Java客户端应用程序(在任何容器不运行),其中i定义了两个路线:

I have created a java client application (not running in any container) where i defined two routes:

ROUTE1:从传入文件夹1文件移动到FOLDER2

route1: move a file from an incoming folder1 to folder2

路径2:从folderx移动文件内容MQ队列

route2: move file content from folderx to mq queue.

我开始我的应用程序和这些路由做他们的工作轮询相应的文件夹和路由信息。

I start my application and these routes are doing their job polling those folders and routing messages accordingly.

任何人都可以解释我的路线是如何工作的。难道骆驼(上下文)创建为每个路由一个线程。到底发生了什么?

Can anyone explain me how the routes work. Does camel(context) create a thread for each route. What exactly happens?

请注意:我找不到这个一个简单的笔记放在骆驼网站

Note: I could not find a straightforward notes on this on the camel site.

推荐答案

这要看你的路由使用的部件,有多少线程被创建和使用。

It depends on the components you use in the routes, how many threads are being created and used.

除了在骆驼某些电子信息产品支持多线程(线程池),因此可以被配置为使用的线程N个

As well as some EIPs in Camel supports multiple threads (thread pools) and thus can be configured to use N number of threads.

在你的榜样,其文件组件,它使用一个线程。当你有2条路线,您将使用2个线程。某些组件还可以配置自己的线程(如线程池)。比如最近我们增加了对这种支持在骆驼2.10文件组件(见ScheduledExecutorService的选项在 http://camel.apache.org/file2

In your example its the file component, and it uses a single thread. As you have 2 routes, you will then use 2 threads. Some components also allows to configure their threading (eg thread pools). For example recently we added support for that for the file component in Camel 2.10 (see the scheduledExecutorService option at http://camel.apache.org/file2)

这里有一些笔记关于骆驼的线程模型
<一href=\"http://camel.apache.org/threading-model.html\">http://camel.apache.org/threading-model.html

There is some notes here about Camel threading model http://camel.apache.org/threading-model.html

这篇关于骆驼是否为每个路由线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆