骆驼路线和终点 [英] Camel Routes and Endpoints

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

问题描述

我已经浇过Apache的骆驼文档试图让两个最具体的了解基本的概念(端点和路由),虽然这些术语在整个文档使用无处不在,我找不到任何引用,实际上定义它们是什么以及它们的用途。虽然他们的名字是相当明显的冠冕堂皇,我的认为的我知道他们是什么,我现在已经被分配给已登陆我的脖子深的Apache的骆驼土地的任务,其绝对至关重要的是,我明白这些机制。

I've been pouring over the Apache Camel docs trying to get a concrete understanding of two of its most basic concepts (endpoints and routes), and although these terms are used everywhere throughout the docs, I can find no reference that actually defines what they are and what they are used for. And although their names are fairly obvious-sounding, and I think I understand what they are, I've now been assigned to a task that has landed me neck-deep in Apache Camel Land, and its absolutely vital that I understand what these mechanisms are.

我的猜测是终结点只是豆 - 一个可以像任何其他的配置文件进行配置 - 这一个名称映射到URI /端口组合(这来自W3C的文档拍摄)。在Apache的骆驼的背景下,我国的的是端点用于组件连接在一起,使路线(连接/图)可以在它们之间形成。因此,当组分A家里端点1想要与组分B家里端点2,所以只要有1至2个的映射,骆驼将能够在这两者之间传输信息的通信。

My guess is that an "endpoint" is just a bean - one that can be configured in a config file like any other - that maps a name to a URI/port combo (this taken from the W3C docs). In the context of Apache Camel, my guess is that endpoints are used to connect components together, so that "routes" (connections/maps) can be formed between them. So when Component A living at Endpoint 1 wants to communicate with Component B living at Endpoint 2, so long as there is a mapping from 1 to 2, Camel will be able to transmit messages between these two.

请阻止我和纠正我,如果我错了这里!

所以,现在,我已经看到了例子,它看起来像的路线可以用Java进行配置:

So now, I've seen examples where it looks like routes can be configured in Java:

from("endpointA").routeId("someMessage").to("endpointB");

和我见过的例子,它看起来像路由在XML中进行配置:

And I've seen examples where it looks like routes can be configured in XML:

<route id="">
    <from .../>
    <to .../>
</route>

是这两种方法路由的配置,或者是他们不同的概念完全?

Are these two methods for configuring routes, or are they different concepts altogether?

最后的什么是可以端点之间进行路由信息的格式?的如果它必须是XML,例如,什么是这些路由的邮件的XSD /架构?如果它是一个Java对象,有什么界限/限制适用于对象骆驼可以发送?

Finally, what is the format of the messages that can be routed between endpoints? If it has to be XML, for example, what is the XSD/schema of these routed messages? If it has to be a Java object, what bounds/restrictions apply to the objects that Camel can send?

提前感谢这些简单的条款有任何明晰,我真的不能找到简单的解释了。

Thanks in advance for any clarity on these simple terms that I truly cannot find simple explanations for.

推荐答案

好像你所得到的概念,一个体面的把握。
我认为它有助于思考更抽象的端点。该骆驼文档是没有太大的帮助在这里。端点可以被认为是作为接口的组件。每个组件都可以有1个或多个端点构成。它帮助我思考一个路线的背景下端点。一个简单的路由可以从端点A去(这可能是一个JMS队列,TCP套接字,文件或任何骆驼组件)和去终结点B(可以是任何骆驼组件)。你当然可以有处理器的路线太那个转换数据。

It seems like you are getting a decent grasp of the concept. I think it helps to think about endpoints in more abstract terms. The camel documentation is not much help here. Endpoints can be thought of as interfaces to a component. Each component can have 1 or more endpoints configured. It helps me to think about endpoints within the context of a route. A simple route can go from Endpoint A (This could be a JMS Queue, tcp socket, file or any camel component) and go to Endpoint B (which can be any camel component). You can of course have processors in the route too that transform the data.

路线的创作,你给的两个例子是正义的,二来创建一个路由方式。它们是相同的概念的例子。首先是Java的DSL和第二使用XML。

The two examples of route creation you give are just that, two ways to create a route. They are the examples of the same concept. The first being Java DSL and the second using XML.

消息的格式通常是XML,和XML可以是任何有效的XML和不需要被捆绑到一个XSD。该消息也可以是任何Java对象。只要它是停留在JVM(即,不打算通过套接字)它并不需要是可序列化

The format of the messages is typically XML, and the XML can be any valid XML and does not need to be tied to an XSD. The message can also be any Java object. As long as it is staying in the JVM (ie, not going over a socket) it doesn't need to be serializeable.

这篇关于骆驼路线和终点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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