[hornetq-commits] JBoss hornetq SVN: r9150 - branches/HnetQ_323_cn/docs/user-manual/zh.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Apr 22 11:01:50 EDT 2010


Author: gaohoward
Date: 2010-04-22 11:01:49 -0400 (Thu, 22 Apr 2010)
New Revision: 9150

Modified:
   branches/HnetQ_323_cn/docs/user-manual/zh/jms-bridge.xml
Log:
done


Modified: branches/HnetQ_323_cn/docs/user-manual/zh/jms-bridge.xml
===================================================================
--- branches/HnetQ_323_cn/docs/user-manual/zh/jms-bridge.xml	2010-04-22 14:57:31 UTC (rev 9149)
+++ branches/HnetQ_323_cn/docs/user-manual/zh/jms-bridge.xml	2010-04-22 15:01:49 UTC (rev 9150)
@@ -17,36 +17,26 @@
 <!-- permitted by applicable law.                                                  -->
 <!-- ============================================================================= -->
 <chapter id="jms-bridge">
-        <title>The JMS Bridge</title>
-        <para>HornetQ includes a fully functional JMS message bridge.</para>
-        <para>The function of the bridge is to consume messages from a source queue or topic, and
-            send them to a target queue or topic, typically on a different server.</para>
-        <para>The source and target servers do not have to be in the same cluster which makes
-            bridging suitable for reliably sending messages from one cluster to another, for
-            instance across a WAN, and where the connection may be unreliable.</para>
-        <para>A bridge can be deployed as a standalone application, with HornetQ standalone server or inside a JBoss AS
-            instance. The source and the target can be located in the same virtual machine or another one.</para>
-        <para>The bridge can also be used to bridge messages from other non HornetQ JMS servers, as
-            long as they are JMS 1.1 compliant.<note><para>Do not confuse a JMS bridge with a core
-                    bridge. A JMS bridge can be used to bridge any two JMS 1.1 compliant JMS
-                    providers and uses the JMS API. A core bridge (described in <xref
-                        linkend="core-bridges"/>) is used to bridge any two HornetQ instances and
-                    uses the core API. Always use a core bridge if you can in preference to a JMS
-                    bridge. The core bridge will typically provide better performance than a JMS
-                    bridge. Also the core bridge can provide <emphasis>once and only once</emphasis>
-                    delivery guarantees without using XA.</para></note></para>
-        <para>The bridge has built-in resilience to failure so if the source or target server
-            connection is lost, e.g. due to network failure, the bridge will retry connecting to the
-            source and/or target until they come back online. When it comes back online it will
-            resume operation as normal.</para>
-        <para>The bridge can be configured with an optional JMS selector, so it will only consume
-            messages matching that JMS selector</para>
-        <para>It can be configured to consume from a queue or a topic. When it consumes from a topic
-            it can be configured to consume using a non durable or durable subscription</para>
-        <para>Typically, the bridge is deployed by the JBoss Micro Container via a beans configuration file.
-            This would typically be deployed inside the JBoss Application Server and the following
-            example shows an example of a beans file that bridges 2 destinations which are actually
-            on the same server. </para>
+        <title>JMS桥(Bridge)</title>
+        <para>HornetQ提供了JMS消息桥服务。</para>
+        <para>桥的作用是从一个消息源队列或话题(topic)接收消息,然后将它们发送到一个目标队列或话题。通常源和
+            目的不在同一台服务器上。</para>
+        <para>作为消息源的服务器与目的服务器不必在同一个集群内。通过桥的作用,两台服务器可以通过非可靠的网络连接
+            起来,比如WAN。</para>
+        <para>桥可以作为单独的服务部署,或者部署于HornetQ单独服务器内,或者部署在JBoss应用服务器中。源或目的可以
+            在同一个VM中,也可以在其它的VM中。</para>
+        <para>桥还可以在HornetQ服务器与其它JMS 1.1 兼容的服务器之间进行消息的传递。
+        <note><para>还要将JMS桥与核心桥混淆。JMB桥可以连接两个JMS 1.1兼容的服务器,它使用的是JMS接口。
+                    而核心桥(在<xref linkend="core-bridges"/>中描述)使用核心API将两个HornetQ实例连接
+                    起来。核心桥的性能通常要比JMS桥的性能高,所以尽可能使用核心桥。另外核心桥可以不用XA
+                    就可以实现<emphasis>一次并只有一次</emphasis>的消息传递保证。</para></note></para>
+        <para>桥可以适当处理连接故障。当源的连接或目的的连接发生故障时,例如网络故障,桥将不断重试连接直到连接
+            恢复为止。当连接恢复后,桥会继续正常工作。</para>
+        <para>桥还可以有一个可选的JMS选择器,它可以使桥只接收选择器选择的消息。</para>
+        <para>可以配置桥从队列还是从话题中接收消息。如果配置成从话题中接收消息,还以设定是以非持久订阅的方式接收,还是
+            以持久订阅的方式接收。</para>
+        <para>通常桥是通过一个bean配置文件由JBoss Micro Container部署到JBoss应用服务器中。下面的就是一
+            个桥的bean文件例子。这个桥将同一服务器上的两个目标连接起来。</para>
         <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?>
 
 &lt;deployment xmlns="urn:jboss:bean-deployer:2.0">
@@ -182,91 +172,78 @@
       &lt;/bean>
 &lt;/deployment></programlisting>
         <section>
-            <title>JMS Bridge Parameters</title>
-            <para>The main bean deployed is the <literal>JMSBridge</literal> bean. The bean is
-                configurable by the parameters passed to its constructor.</para>
+            <title>JMS桥的配置参数</title>
+            <para>桥的主要的bean是<literal>JMSBridge</literal>。所有的配置参数需要传递给这个bean的
+                构造函数。</para>
             <note>
-                <para>To let a parameter be unspecified (for example, if the authentication is
-                    anonymous or no message selector is provided), use <literal>&lt;null
-                        /&gt;</literal> for the unspecified parameter value.</para>
+                <para>如果不想指定某个参数的值(例如匿名认证或没有选择器),将该参数设为<literal>&lt;null
+                        /&gt;</literal>即可。</para>
             </note>
             <itemizedlist>
                 <listitem>
-                    <para>Source Connection Factory Factory</para>
-                    <para>This injects the <literal>SourceCFF</literal> bean (also defined in the
-                        beans file). This bean is used to create the <emphasis>source</emphasis>
-                        <literal>ConnectionFactory</literal>
+                    <para>源连接工厂的工厂(Source ConnectionFactory Factory)</para>
+                    <para>这个参数注入一个<literal>SourceCFF</literal>bean(由bean文件定义)。它被
+                        用来创建<emphasis>源</emphasis>的<literal>ConnectionFactory</literal>
                     </para>
                 </listitem>
                 <listitem>
-                    <para>Target Connection Factory Factory</para>
-                    <para>This injects the <literal>TargetCFF</literal> bean (also defined in the
-                        beans file). This bean is used to create the <emphasis>target</emphasis>
-                        <literal>ConnectionFactory</literal>
+                    <para>目标连接工厂的工厂(Target ConnectionFactory Factory)</para>
+                    <para>这个参数注入一个<literal>TargetCFF</literal>bean(由bean文件定义)。它被
+                        用来创建<emphasis>目的</emphasis>的<literal>ConnectionFactory</literal>
                     </para>
                 </listitem>
                 <listitem>
-                    <para>Source Destination Factory Factory</para>
-                    <para>This injects the <literal>SourceDestinationFactory</literal> bean (also
-                        defined in the beans file). This bean is used to create the
-                            <emphasis>source</emphasis>
-                        <literal>Destination</literal>
+                    <para>源目标工厂(Source DestinationFactory)</para>
+                    <para>这个参数注入一个<literal>SourceDestinationFactory</literal>bean(由
+                        bean文件定义)。它用来创建<emphasis>源</emphasis>
+                        <literal>目标(Destination)</literal>
                     </para>
                 </listitem>
                 <listitem>
-                    <para>Target Destination Factory Factory</para>
-                    <para>This injects the <literal>TargetDestinationFactory</literal> bean (also
-                        defined in the beans file). This bean is used to create the
-                            <emphasis>target</emphasis>
-                        <literal>Destination</literal>
+                    <para>目的目标工厂(Target DestinationFactory)</para>
+                    <para>这个参数注入一个<literal>TargetDestinationFactory</literal>bean(由
+                        bean文件定义)。它用来创建<emphasis>目的</emphasis>
+                        <literal>目标(Destination)</literal>
                     </para>
                 </listitem>
                 <listitem>
-                    <para>Source User Name</para>
-                    <para>this parameter is the username for creating the
-                            <emphasis>source</emphasis> connection</para>
+                    <para>源用户名(Source User Name)</para>
+                    <para>用于创建到<emphasis>源</emphasis>的连接的用户名</para>
                 </listitem>
                 <listitem>
-                    <para>Source Password</para>
-                    <para>this parameter is the parameter for creating the
-                            <emphasis>source</emphasis> connection</para>
+                    <para>源密码(Source Password)</para>
+                    <para>用于创建<emphasis>源</emphasis>连接的密码</para>
                 </listitem>
                 <listitem>
-                    <para>Target User Name</para>
-                    <para>this parameter is the username for creating the
-                            <emphasis>target</emphasis> connection</para>
+                    <para>目的用户名(Target User Name)</para>
+                    <para>用于创建<emphasis>目的</emphasis>连接的用户名</para>
                 </listitem>
                 <listitem>
-                    <para>Target Password</para>
-                    <para>this parameter is the password for creating the
-                            <emphasis>target</emphasis> connection</para>
+                    <para>目的密码(Target Password)</para>
+                    <para>t用于创建<emphasis>目的</emphasis>连接的密码</para>
                 </listitem>
                 <listitem>
-                    <para>Selector</para>
-                    <para>This represents a JMS selector expression used for consuming messages from
-                        the source destination. Only messages that match the selector expression
-                        will be bridged from the source to the target destination</para>
-                    <para>The selector expression must follow the <ulink
+                    <para>选择器(Selector)</para>
+                    <para>这是一个JMS的选择器表达式,它用于从源目标接收消息。只有与选择器相匹配的消息才会被桥
+                        转发到目的目标</para>
+                    <para>选择器必须符合<ulink
                             url="http://java.sun.com/j2ee/1.4/docs/api/javax/jms/Message.html">JMS
-                            selector syntax</ulink></para>
+                            选择器语法</ulink></para>
                 </listitem>
                 <listitem>
-                    <para>Failure Retry Interval</para>
-                    <para>This represents the amount of time in ms to wait between trying to
-                        recreate connections to the source or target servers when the bridge has
-                        detected they have failed</para>
+                    <para>故障重试间隔(Failure Retry Interval)</para>
+                    <para>代表当桥发现连接故障时在每两次重试连接之间所要等待的时间间隔,单位毫秒</para>
                 </listitem>
                 <listitem>
-                    <para>Max Retries</para>
-                    <para>This represents the number of times to attempt to recreate connections to
-                        the source or target servers when the bridge has detected they have failed.
-                        The bridge will give up after trying this number of times. <literal
-                            >-1</literal> represents 'try forever'</para>
+                    <para>最大重试次数(Max Retries)</para>
+                    <para>表示桥在发现连接故障时所进行的最大重试次数。超过这个次数,桥就放弃重试。
+                          <literal
+                            >-1</literal>代表一直重试下去</para>
                 </listitem>
                 <listitem>
-                    <para>Quality Of Service</para>
-                    <para>This parameter represents the desired quality of service mode</para>
-                    <para>Possible values are:</para>
+                    <para>服务质量(Quality Of Service)</para>
+                    <para>这个参数代表所需要的服务质量模式</para>
+                    <para>有效的值为:</para>
                     <itemizedlist>
                         <listitem>
                             <para><literal>AT_MOST_ONCE</literal></para>
@@ -278,138 +255,104 @@
                             <para><literal>ONCE_AND_ONLY_ONCE</literal></para>
                         </listitem>
                     </itemizedlist>
-                    <para>See <xref linkend="quality-of-service"/> for a explanation of these
-                        modes.</para>
+                    <para>有关这些模式的解释,参见<xref linkend="quality-of-service"/>。</para>
                 </listitem>
                 <listitem>
-                    <para>Max Batch Size</para>
-                    <para>This represents the maximum number of messages to consume from the source
-                        destination before sending them in a batch to the target destination. Its
-                        value must <literal>>= 1</literal>
+                    <para>最大批量(Max Batch Size)</para>
+                    <para>表示桥一次性从源目标最多接收多少消息,并将它们一次发往目的地。它的值必须是
+                        <literal>>= 1</literal>
                     </para>
                 </listitem>
                 <listitem>
-                    <para>Max Batch Time</para>
-                    <para>This represents the maximum number of milliseconds to wait before sending
-                        a batch to target, even if the number of messages consumed has not reached
-                            <literal>MaxBatchSize</literal>. Its value must be <literal>-1</literal>
-                        to represent 'wait forever', or <literal>>= 1</literal> to specify an actual
-                        time </para>
+                    <para>最大批时间(Max Batch Time)</para>
+                    <para>代表桥在将一批消息发向目的之前等待的最大毫秒数。这个时间过后,即使接收的消息数小于
+                        <literal>MaxBatchSize</literal>,桥也会开始向目的发送消息。它的值必须是
+                        <literal>-1</literal> (代表永远等待)或<literal>>= 1</literal>。</para>
                 </listitem>
                 <listitem>
-                    <para>Subscription Name</para>
-                    <para>If the source destination represents a topic, and you want to consume from
-                        the topic using a durable subscription then this parameter represents the
-                        durable subscription name</para>
+                    <para>订阅名(Subscription Name)</para>
+                    <para>如果源的目标是一个话题(topic),你想使用持久的订阅来接收消息的话,这个参数可以指定
+                        订阅名。</para>
                 </listitem>
                 <listitem>
-                    <para>Client ID</para>
-                    <para>If the source destination represents a topic, and you want to consume from
-                        the topic using a durable subscription then this attribute represents the
-                        the JMS client ID to use when creating/looking up the durable
-                        subscription</para>
+                    <para>客户ID(Client ID)</para>
+                    <para>如果源的目标是一个话题(topic),你想使用持久的订阅来接收消息的话,这个参数可以指定
+                        JMS的客户ID。它用于创建/查找持久订阅。</para>
                 </listitem>
                 <listitem>
-                    <para>Add MessageID In Header</para>
-                    <para>If <literal>true</literal>, then the original message's message ID will be
-                        appended in the message sent to the destination in the header <literal
-                            >HORNETQ_BRIDGE_MSG_ID_LIST</literal>. If the message is bridged more
-                        than once, each message ID will be appended. This enables a distributed
-                        request-response pattern to be used</para>
+                    <para>在消息头添加MessageID(Add MessageID In Header)</para>
+                    <para>如果值为<literal>true</literal>,原始的消息ID在发往目的是回到消息的名为<literal
+                            >HORNETQ_BRIDGE_MSG_ID_LIST</literal>的头中。如果一个消息被桥转发了多次,
+                        则每次转发的消息ID都添加在这个头中。这用于分布式请求/回答的消息模式。</para>
                     <note>
-                        <para>when you receive the message you can send back a response using the
-                            correlation id of the first message id, so when the original sender gets
-                            it back it will be able to correlate it. </para>
+                        <para>当收到一个消息时,通过它的相关ID(coorelation id)可以发送一个回答。这样
+                            在消息发送方得到这个回答消息时,它可以与原消息相关联起来。</para>
                     </note>
                 </listitem>
                <listitem>
-                   <para>MBean Server</para>
-                   <para>To manage the JMS Bridge using JMX, set the MBeanServer where the JMS Bridge MBean
-                      must be registered (e.g. the JVM Platform MBeanServer or JBoss AS MBeanServer)</para>
+                   <para>MBean服务器(MBean Server)</para>
+                   <para>要使用JMX管理JMS桥,需指定JMS桥所要注册的MBeanServer(如JVM Platform MBeanServer 或
+                      JBoss 应用服务器的MBeanServer)</para>
                </listitem>
                <listitem>
                    <para>ObjectName</para>
-                   <para>If you set the MBeanServer, you also need to set the ObjectName used to register
-                      the JMS Bridge MBean (must be unique)</para>
+                   <para>设置了MBeanServer后,你还需要设置JMS桥MBean注册用的ObjectName(必须是唯一的)</para>
                </listitem>
             </itemizedlist>
         </section>
         <section>
-            <title>Source and Target Connection Factories</title>
-            <para>The source and target connection factory factories are used to create the
-                connection factory used to create the connection for the source or target
-                server.</para>
-            <para>The configuration example above uses the default implementation provided by
-                HornetQ that looks up the connection factory using JNDI. For other Application
-                Servers or JMS providers a new implementation may have to be provided. This can
-                easily be done by implementing the interface <literal
-                    >org.hornetq.jms.bridge.ConnectionFactoryFactory</literal>.</para>
+            <title>源和目的的连接工厂</title>
+            <para>源工目的的连接工厂分别用于创建到源和到目的的连接。</para>
+            <para>上面的配置例子中使用的是HornetQ提供的默认实现。它使用JNDI查找连接工厂。对于其它的应用服务器
+                或JMS提供者,需要实现相应的实现,即实现<literal
+                    >org.hornetq.jms.bridge.ConnectionFactoryFactory</literal>接口。</para>
         </section>
         <section>
-            <title>Source and Target Destination Factories</title>
-            <para>Again, similarly, these are used to create or lookup up the destinations.</para>
-            <para>In the configuration example above, we have used the default provided by HornetQ
-                that looks up the destination using JNDI.</para>
-            <para>A new implementation can be provided by implementing <literal
-                    >org.hornetq.jms.bridge.DestinationFactory</literal> interface.</para>
+            <title>源和目的的目标工厂</title>
+            <para>它们用来创建或查找相应的目标。</para>
+            <para>上面例子中,我们使用了HornetQ的默认实现,从JNDI中查找相应的对象。</para>
+            <para>要提供新的实现,只要实现接口<literal
+                    >org.hornetq.jms.bridge.DestinationFactory</literal>即可。</para>
         </section>
         <section id="quality-of-service">
-            <title>Quality Of Service</title>
-            <para>The quality of service modes used by the bridge are described here in more
-                detail.</para>
+            <title>服务质量</title>
+            <para>下面给是桥的三种服务质量的详细说明。</para>
             <section>
                 <title>AT_MOST_ONCE</title>
-                <para>With this QoS mode messages will reach the destination from the source at most
-                    once. The messages are consumed from the source and acknowledged before sending
-                    to the destination. Therefore there is a possibility that if failure occurs
-                    between removing them from the source and them arriving at the destination they
-                    could be lost. Hence delivery will occur at most once.</para>
-                <para>This mode is available for both durable and non-durable messages.</para>
+                <para>这种QoS模式表示的是消息最多送达目标一次。在消息发往目的之前,消息就会被通知。因此,
+                    如果在消息被源删除但并未到达目的时发生故障,消息有可能丢失。所以说消息的
+                    发送最多一次。 </para>
+                <para>这个模式适用于持久或非持久的消息。</para>
             </section>
             <section>
                 <title>DUPLICATES_OK</title>
-                <para>With this QoS mode, the messages are consumed from the source and then
-                    acknowledged after they have been successfully sent to the destination.
-                    Therefore there is a possibility that if failure occurs after sending to the
-                    destination but before acknowledging them, they could be sent again when the
-                    system recovers. I.e. the destination might receive duplicates after a
-                    failure.</para>
-                <para>This mode is available for both durable and non-durable messages.</para>
+                <para>在这个QoS模式下,消息从源接收后再发送到目的,之后才对源进行消息通知。这样如果在发送成功之后
+                    消息通知前的时间内发生故障的话,在故障恢复时同一个消息可能被再次传递。結果可能是在目的处
+                    该消息收到了两次。</para>
+                <para>这个模式适用于持久或非持久的消息。</para>
             </section>
             <section>
                 <title>ONCE_AND_ONLY_ONCE</title>
-                <para>This QoS mode ensures messages will reach the destination from the source once
-                    and only once. (Sometimes this mode is known as "exactly once"). If both the
-                    source and the destination are on the same HornetQ server instance then this can
-                    be achieved by sending and acknowledging the messages in the same local
-                    transaction. If the source and destination are on different servers this is
-                    achieved by enlisting the sending and consuming sessions in a JTA transaction.
-                    The JTA transaction is controlled by JBoss Transactions JTA * implementation
-                    which is a fully recovering transaction manager, thus providing a very high
-                    degree of durability. If JTA is required then both supplied connection factories
-                    need to be XAConnectionFactory implementations. This is likely to be the slowest
-                    mode since it requires extra persistence for the transaction logging.</para>
-                <para>This mode is only available for durable messages.</para>
+                <para>这个模式保证消息从源发送到目的一次,并且只有一次。(有时这个模式又称为“只一次”)。若源与目的处于
+                    同一个HornetQ服务器中,这个模式通过本地事务来保证消息的发送和通知。如果是在不同的服务器上,
+                    则会使用一个JTA的事务将发送和接收包括其中。这里使用的JTA事务是JBoss的实现,它包含有一个
+                    完整的事务恢复管理器,所以能提供高度可靠的持久性。如果使用JTA则桥的所有连接工厂必须是
+                    XAConnectionFactory。这种模式的效率通常是最低的,因为它需要额外记录事务的日志。</para>
+                <para>这个模式只适用于持久性消息。</para>
                 <note>
-                    <para>For a specific application it may possible to provide once and only once
-                        semantics without using the ONCE_AND_ONLY_ONCE QoS level. This can be done
-                        by using the DUPLICATES_OK mode and then checking for duplicates at the
-                        destination and discarding them. Some JMS servers provide automatic
-                        duplicate message detection functionality, or this may be possible to
-                        implement on the application level by maintaining a cache of received
-                        message ids on disk and comparing received messages to them. The cache would
-                        only be valid for a certain period of time so this approach is not as
-                        watertight as using ONCE_AND_ONLY_ONCE but may be a good choice depending on
-                        your specific application.</para>
+                    <para>某些情况下可以不使用ONCE_AND_ONLY_ONCE模式,而同样可以保证“一次且只一次”的效果。
+                        这是通过使用DUPLICATES_OK模式,加上在目的端应用程序来检测重复的消息,如果有则将其丢弃。
+                        一些JMS服务器本身提供自动重复消息检测的功能,这样节省了在应用层实现的工作。在应用层常见
+                        的实现方法是将接收到的消息的ID存放到缓存文件中,然后与每个新到的消息进行对比。这种方式
+                        可能在某段时间内有效,所以它不如ONCE_AND_ONLY_ONCE那样严格,它视具体情况也可能是一个
+                        不错的选择。</para>
                 </note>
             </section>
             <section>
-                <title>Examples</title>
-                <para>Please see <xref linkend="examples.javaee.jms-bridge"/> which shows how to configure
-                    and use a JMS Bridge with JBoss AS to send messages to the source destination and consume them
-                    from the target destination.</para>
-                <para>Please see <xref linkend="examples.jms.jms-bridge"/> which shows how to configure
-                    and use a JMS Bridge between two standalone HornetQ servers.</para>
+                <title>例子</title>
+                <para>参见<xref linkend="examples.javaee.jms-bridge"/>。这个例子展示了如何在JBoss应用服务器中配置并使用
+                    JMS桥从一处目标将消息转发到另一个目标。</para>
+                <para>关于如何在两个单独HornetQ服务器间使用桥的例子,请参见<xref linkend="examples.jms.jms-bridge"/>。</para>
             </section>
         </section>
 </chapter>



More information about the hornetq-commits mailing list