You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by gi...@apache.org on 2021/05/10 03:19:43 UTC

[incubator-inlong-website] branch asf-site updated: Automated deployment: Mon May 10 03:19:32 UTC 2021 66a5a92265606b77409f9152ee8c6b453b4dcbc5

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-inlong-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new d09a82f  Automated deployment: Mon May 10 03:19:32 UTC 2021 66a5a92265606b77409f9152ee8c6b453b4dcbc5
d09a82f is described below

commit d09a82fca4e552527fee50a0513d3e6d91d1ee98
Author: gosonzhang <go...@users.noreply.github.com>
AuthorDate: Mon May 10 03:19:32 2021 +0000

    Automated deployment: Mon May 10 03:19:32 UTC 2021 66a5a92265606b77409f9152ee8c6b453b4dcbc5
---
 docs/zh-cn/producer_example.md   |  22 ++--
 zh-cn/docs/producer_example.html | 219 ++++++++++++++++++++-------------------
 zh-cn/docs/producer_example.json |   2 +-
 zh-cn/docs/producer_example.md   |  22 ++--
 4 files changed, 134 insertions(+), 131 deletions(-)

diff --git a/docs/zh-cn/producer_example.md b/docs/zh-cn/producer_example.md
index 9d29451..e71f37d 100644
--- a/docs/zh-cn/producer_example.md
+++ b/docs/zh-cn/producer_example.md
@@ -7,8 +7,8 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
   - TubeSingleSessionFactory 在整个生命周期只会创建一个 session
   - TubeMultiSessionFactory 每次调用都会创建一个session
 
-### TubeSingleSessionFactory
-   #### Send Message Synchronously
+1. TubeSingleSessionFactory
+   - Send Message Synchronously
      ```java
      public final class SyncProducerExample {
     
@@ -28,10 +28,10 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
             }
             messageProducer.shutdown();
         }
-    }
-    ```
+     }
+     ```
      
-   #### Send Message Asynchronously
+   - Send Message Asynchronously
      ```java
      public final class AsyncProducerExample {
      
@@ -62,10 +62,10 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
             messageProducer.shutdown();
         }
 
-    }
-    ```
+     }
+     ```
      
-   #### Send Message With Attributes
+   - Send Message With Attributes
      ```java
      public final class ProducerWithAttributeExample {
      
@@ -87,11 +87,9 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
             messageProducer.sendMessage(message);
             messageProducer.shutdown();
         }
-
-    }
-    ```
+     }```
      
-### TubeMultiSessionFactory
+- TubeMultiSessionFactory
 
     ```java
     public class MultiSessionProducerExample {
diff --git a/zh-cn/docs/producer_example.html b/zh-cn/docs/producer_example.html
index 1dded19..d6d2a8c 100644
--- a/zh-cn/docs/producer_example.html
+++ b/zh-cn/docs/producer_example.html
@@ -18,145 +18,152 @@
 <li>TubeSingleSessionFactory 在整个生命周期只会创建一个 session</li>
 <li>TubeMultiSessionFactory 每次调用都会创建一个session</li>
 </ul>
-<h3>TubeSingleSessionFactory</h3>
-<h4>Send Message Synchronously</h4>
-<pre><code> ```java
- public final class SyncProducerExample {
+<ol>
+<li>TubeSingleSessionFactory
+<ul>
+<li>
+<p>Send Message Synchronously</p>
+<pre><code class="language-java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">final</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">SyncProducerExample</span> </span>{
 
-    public static void main(String[] args) throws Throwable {
-        final String masterHostAndPort = &quot;localhost:8000&quot;;
-        final TubeClientConfig clientConfig = new TubeClientConfig(masterHostAndPort);
-        final MessageSessionFactory messageSessionFactory = new TubeSingleSessionFactory(clientConfig);
-        final MessageProducer messageProducer = messageSessionFactory.createProducer();
-        final String topic = &quot;test&quot;;
-        final String body = &quot;This is a test message from single-session-factory!&quot;;
-        byte[] bodyData = StringUtils.getBytesUtf8(body);
-        messageProducer.publish(topic);
-        Message message = new Message(topic, bodyData);
-        MessageSentResult result = messageProducer.sendMessage(message);
-        if (result.isSuccess()) {
-            System.out.println(&quot;sync send message : &quot; + message);
-        }
-        messageProducer.shutdown();
-    }
+   <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> Throwable </span>{
+       <span class="hljs-keyword">final</span> String masterHostAndPort = <span class="hljs-string">"localhost:8000"</span>;
+       <span class="hljs-keyword">final</span> TubeClientConfig clientConfig = <span class="hljs-keyword">new</span> TubeClientConfig(masterHostAndPort);
+       <span class="hljs-keyword">final</span> MessageSessionFactory messageSessionFactory = <span class="hljs-keyword">new</span> TubeSingleSessionFactory(clientConfig);
+       <span class="hljs-keyword">final</span> MessageProducer messageProducer = messageSessionFactory.createProducer();
+       <span class="hljs-keyword">final</span> String topic = <span class="hljs-string">"test"</span>;
+       <span class="hljs-keyword">final</span> String body = <span class="hljs-string">"This is a test message from single-session-factory!"</span>;
+       <span class="hljs-keyword">byte</span>[] bodyData = StringUtils.getBytesUtf8(body);
+       messageProducer.publish(topic);
+       Message message = <span class="hljs-keyword">new</span> Message(topic, bodyData);
+       MessageSentResult result = messageProducer.sendMessage(message);
+       <span class="hljs-keyword">if</span> (result.isSuccess()) {
+           System.out.println(<span class="hljs-string">"sync send message : "</span> + message);
+       }
+       messageProducer.shutdown();
+   }
 }
-```
 </code></pre>
-<h4>Send Message Asynchronously</h4>
-<pre><code> ```java
- public final class AsyncProducerExample {
- 
-    public static void main(String[] args) throws Throwable {
-        final String masterHostAndPort = &quot;localhost:8000&quot;;
-        final TubeClientConfig clientConfig = new TubeClientConfig(masterHostAndPort);
-        final MessageSessionFactory messageSessionFactory = new TubeSingleSessionFactory(clientConfig);
-        final MessageProducer messageProducer = messageSessionFactory.createProducer();
-        final String topic = &quot;test&quot;;
-        final String body = &quot;async send message from single-session-factory!&quot;;
-        byte[] bodyData = StringUtils.getBytesUtf8(body);
-        messageProducer.publish(topic);
-        final Message message = new Message(topic, bodyData);
-        messageProducer.sendMessage(message, new MessageSentCallback(){
-            @Override
-            public void onMessageSent(MessageSentResult result) {
-                if (result.isSuccess()) {
-                    System.out.println(&quot;async send message : &quot; + message);
-                } else {
-                    System.out.println(&quot;async send message failed : &quot; + result.getErrMsg());
-                }
-            }
-            @Override
-            public void onException(Throwable e) {
-                System.out.println(&quot;async send message error : &quot; + e);
-            }
-        });
-        messageProducer.shutdown();
-    }
+</li>
+<li>
+<p>Send Message Asynchronously</p>
+<pre><code class="language-java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">final</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">AsyncProducerExample</span> </span>{
+
+   <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> Throwable </span>{
+       <span class="hljs-keyword">final</span> String masterHostAndPort = <span class="hljs-string">"localhost:8000"</span>;
+       <span class="hljs-keyword">final</span> TubeClientConfig clientConfig = <span class="hljs-keyword">new</span> TubeClientConfig(masterHostAndPort);
+       <span class="hljs-keyword">final</span> MessageSessionFactory messageSessionFactory = <span class="hljs-keyword">new</span> TubeSingleSessionFactory(clientConfig);
+       <span class="hljs-keyword">final</span> MessageProducer messageProducer = messageSessionFactory.createProducer();
+       <span class="hljs-keyword">final</span> String topic = <span class="hljs-string">"test"</span>;
+       <span class="hljs-keyword">final</span> String body = <span class="hljs-string">"async send message from single-session-factory!"</span>;
+       <span class="hljs-keyword">byte</span>[] bodyData = StringUtils.getBytesUtf8(body);
+       messageProducer.publish(topic);
+       <span class="hljs-keyword">final</span> Message message = <span class="hljs-keyword">new</span> Message(topic, bodyData);
+       messageProducer.sendMessage(message, <span class="hljs-keyword">new</span> MessageSentCallback(){
+           <span class="hljs-meta">@Override</span>
+           <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onMessageSent</span><span class="hljs-params">(MessageSentResult result)</span> </span>{
+               <span class="hljs-keyword">if</span> (result.isSuccess()) {
+                   System.out.println(<span class="hljs-string">"async send message : "</span> + message);
+               } <span class="hljs-keyword">else</span> {
+                   System.out.println(<span class="hljs-string">"async send message failed : "</span> + result.getErrMsg());
+               }
+           }
+           <span class="hljs-meta">@Override</span>
+           <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">onException</span><span class="hljs-params">(Throwable e)</span> </span>{
+               System.out.println(<span class="hljs-string">"async send message error : "</span> + e);
+           }
+       });
+       messageProducer.shutdown();
+   }
 
 }
-```
 </code></pre>
-<h4>Send Message With Attributes</h4>
-<pre><code> ```java
- public final class ProducerWithAttributeExample {
- 
-    public static void main(String[] args) throws Throwable {
-        final String masterHostAndPort = &quot;localhost:8000&quot;;
-        final TubeClientConfig clientConfig = new TubeClientConfig(masterHostAndPort);
-        final MessageSessionFactory messageSessionFactory = new TubeSingleSessionFactory(clientConfig);
-        final MessageProducer messageProducer = messageSessionFactory.createProducer();
-        final String topic = &quot;test&quot;;
-        final String body = &quot;send message with attribute from single-session-factory!&quot;;
-        byte[] bodyData = StringUtils.getBytesUtf8(body);
-        messageProducer.publish(topic);
-        Message message = new Message(topic, bodyData);
-        //set attribute
-        message.setAttrKeyVal(&quot;test_key&quot;, &quot;test value&quot;);
-        //msgType is used for consumer filtering, and msgTime(accurate to minute) is used as the pipe to send and receive statistics
-        SimpleDateFormat sdf = new SimpleDateFormat(&quot;yyyyMMddHHmm&quot;);
-        message.putSystemHeader(&quot;test&quot;, sdf.format(new Date()));
-        messageProducer.sendMessage(message);
-        messageProducer.shutdown();
-    }
+</li>
+<li>
+<p>Send Message With Attributes</p>
+<pre><code class="language-java"><span class="hljs-keyword">public</span> <span class="hljs-keyword">final</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ProducerWithAttributeExample</span> </span>{
+
+   <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> Throwable </span>{
+       <span class="hljs-keyword">final</span> String masterHostAndPort = <span class="hljs-string">"localhost:8000"</span>;
+       <span class="hljs-keyword">final</span> TubeClientConfig clientConfig = <span class="hljs-keyword">new</span> TubeClientConfig(masterHostAndPort);
+       <span class="hljs-keyword">final</span> MessageSessionFactory messageSessionFactory = <span class="hljs-keyword">new</span> TubeSingleSessionFactory(clientConfig);
+       <span class="hljs-keyword">final</span> MessageProducer messageProducer = messageSessionFactory.createProducer();
+       <span class="hljs-keyword">final</span> String topic = <span class="hljs-string">"test"</span>;
+       <span class="hljs-keyword">final</span> String body = <span class="hljs-string">"send message with attribute from single-session-factory!"</span>;
+       <span class="hljs-keyword">byte</span>[] bodyData = StringUtils.getBytesUtf8(body);
+       messageProducer.publish(topic);
+       Message message = <span class="hljs-keyword">new</span> Message(topic, bodyData);
+       <span class="hljs-comment">//set attribute</span>
+       message.setAttrKeyVal(<span class="hljs-string">"test_key"</span>, <span class="hljs-string">"test value"</span>);
+       <span class="hljs-comment">//msgType is used for consumer filtering, and msgTime(accurate to minute) is used as the pipe to send and receive statistics</span>
+       SimpleDateFormat sdf = <span class="hljs-keyword">new</span> SimpleDateFormat(<span class="hljs-string">"yyyyMMddHHmm"</span>);
+       message.putSystemHeader(<span class="hljs-string">"test"</span>, sdf.format(<span class="hljs-keyword">new</span> Date()));
+       messageProducer.sendMessage(message);
+       messageProducer.shutdown();
+   }
+}```
 
-}
-```
 </code></pre>
-<h3>TubeMultiSessionFactory</h3>
-<pre><code>```java
-public class MultiSessionProducerExample {
+</li>
+</ul>
+</li>
+</ol>
+<ul>
+<li>
+<p>TubeMultiSessionFactory</p>
+<pre><code class="language-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MultiSessionProducerExample</span> </span>{
     
-    public static void main(String[] args) throws Throwable {
-        final int SESSION_FACTORY_NUM = 10;
-        final String masterHostAndPort = &quot;localhost:8000&quot;;
-        final TubeClientConfig clientConfig = new TubeClientConfig(masterHostAndPort);
-        final List&lt;MessageSessionFactory&gt; sessionFactoryList = new ArrayList&lt;&gt;(SESSION_FACTORY_NUM);
-        final ExecutorService sendExecutorService = Executors.newFixedThreadPool(SESSION_FACTORY_NUM);
-        final CountDownLatch latch = new CountDownLatch(SESSION_FACTORY_NUM);
-        for (int i = 0; i &lt; SESSION_FACTORY_NUM; i++) {
-            TubeMultiSessionFactory tubeMultiSessionFactory = new TubeMultiSessionFactory(clientConfig);
+    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> <span class="hljs-keyword">throws</span> Throwable </span>{
+        <span class="hljs-keyword">final</span> <span class="hljs-keyword">int</span> SESSION_FACTORY_NUM = <span class="hljs-number">10</span>;
+        <span class="hljs-keyword">final</span> String masterHostAndPort = <span class="hljs-string">"localhost:8000"</span>;
+        <span class="hljs-keyword">final</span> TubeClientConfig clientConfig = <span class="hljs-keyword">new</span> TubeClientConfig(masterHostAndPort);
+        <span class="hljs-keyword">final</span> List&lt;MessageSessionFactory&gt; sessionFactoryList = <span class="hljs-keyword">new</span> ArrayList&lt;&gt;(SESSION_FACTORY_NUM);
+        <span class="hljs-keyword">final</span> ExecutorService sendExecutorService = Executors.newFixedThreadPool(SESSION_FACTORY_NUM);
+        <span class="hljs-keyword">final</span> CountDownLatch latch = <span class="hljs-keyword">new</span> CountDownLatch(SESSION_FACTORY_NUM);
+        <span class="hljs-keyword">for</span> (<span class="hljs-keyword">int</span> i = <span class="hljs-number">0</span>; i &lt; SESSION_FACTORY_NUM; i++) {
+            TubeMultiSessionFactory tubeMultiSessionFactory = <span class="hljs-keyword">new</span> TubeMultiSessionFactory(clientConfig);
             sessionFactoryList.add(tubeMultiSessionFactory);
             MessageProducer producer = tubeMultiSessionFactory.createProducer();
-            Sender sender = new Sender(producer, latch);
+            Sender sender = <span class="hljs-keyword">new</span> Sender(producer, latch);
             sendExecutorService.submit(sender);
         }
         latch.await();
         sendExecutorService.shutdownNow();
-        for (MessageSessionFactory sessionFactory : sessionFactoryList) {
+        <span class="hljs-keyword">for</span> (MessageSessionFactory sessionFactory : sessionFactoryList) {
             sessionFactory.shutdown();
         }
     }
 
-    private static class Sender implements Runnable {
+    <span class="hljs-keyword">private</span> <span class="hljs-keyword">static</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Sender</span> <span class="hljs-keyword">implements</span> <span class="hljs-title">Runnable</span> </span>{
         
-        private MessageProducer producer;
+        <span class="hljs-keyword">private</span> MessageProducer producer;
         
-        private CountDownLatch latch;
+        <span class="hljs-keyword">private</span> CountDownLatch latch;
 
-        public Sender(MessageProducer producer, CountDownLatch latch) {
-            this.producer = producer;
-            this.latch = latch;
+        <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-title">Sender</span><span class="hljs-params">(MessageProducer producer, CountDownLatch latch)</span> </span>{
+            <span class="hljs-keyword">this</span>.producer = producer;
+            <span class="hljs-keyword">this</span>.latch = latch;
         }
 
-        @Override
-        public void run() {
-            final String topic = &quot;test&quot;;
-            try {
+        <span class="hljs-meta">@Override</span>
+        <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">run</span><span class="hljs-params">()</span> </span>{
+            <span class="hljs-keyword">final</span> String topic = <span class="hljs-string">"test"</span>;
+            <span class="hljs-keyword">try</span> {
                 producer.publish(topic);
-                final byte[] bodyData = StringUtils.getBytesUtf8(&quot;This is a test message from multi-session factory&quot;);
-                Message message = new Message(topic, bodyData);
+                <span class="hljs-keyword">final</span> <span class="hljs-keyword">byte</span>[] bodyData = StringUtils.getBytesUtf8(<span class="hljs-string">"This is a test message from multi-session factory"</span>);
+                Message message = <span class="hljs-keyword">new</span> Message(topic, bodyData);
                 producer.sendMessage(message);
                 producer.shutdown();
-            } catch (Throwable ex) {
-                System.out.println(&quot;send message error : &quot; + ex);
-            } finally {
+            } <span class="hljs-keyword">catch</span> (Throwable ex) {
+                System.out.println(<span class="hljs-string">"send message error : "</span> + ex);
+            } <span class="hljs-keyword">finally</span> {
                 latch.countDown();
             }
         }
     }
 }
-```
 </code></pre>
+</li>
+</ul>
 </div></section><footer class="footer-container"><div class="footer-body"><img src="/img/incubator-logo.svg"/><div class="cols-container"><div class="col col-24"><p>Apache InLong (incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with  [...]
 	<script src="https://f.alicdn.com/react/15.4.1/react-with-addons.min.js"></script>
 	<script src="https://f.alicdn.com/react/15.4.1/react-dom.min.js"></script>
diff --git a/zh-cn/docs/producer_example.json b/zh-cn/docs/producer_example.json
index b998dc2..9c6c2ff 100644
--- a/zh-cn/docs/producer_example.json
+++ b/zh-cn/docs/producer_example.json
@@ -1,6 +1,6 @@
 {
   "filename": "producer_example.md",
-  "__html": "<h2>Producer 示例</h2>\n<p>TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactory 和 TubeMultiSessionFactory。</p>\n<ul>\n<li>TubeSingleSessionFactory 在整个生命周期只会创建一个 session</li>\n<li>TubeMultiSessionFactory 每次调用都会创建一个session</li>\n</ul>\n<h3>TubeSingleSessionFactory</h3>\n<h4>Send Message Synchronously</h4>\n<pre><code> ```java\n public final class SyncProducerExample {\n\n    public static void main(String[] args) throws Throwable {\n        final String masterHostAndPort  [...]
+  "__html": "<h2>Producer 示例</h2>\n<p>TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactory 和 TubeMultiSessionFactory。</p>\n<ul>\n<li>TubeSingleSessionFactory 在整个生命周期只会创建一个 session</li>\n<li>TubeMultiSessionFactory 每次调用都会创建一个session</li>\n</ul>\n<ol>\n<li>TubeSingleSessionFactory\n<ul>\n<li>\n<p>Send Message Synchronously</p>\n<pre><code class=\"language-java\"><span class=\"hljs-keyword\">public</span> <span class=\"hljs-keyword\">final</span> <span class=\"hljs-class\"><span clas [...]
   "link": "/zh-cn/docs/producer_example.html",
   "meta": {
     "title": "生产者示例 - Apache TubeMQ"
diff --git a/zh-cn/docs/producer_example.md b/zh-cn/docs/producer_example.md
index 9d29451..e71f37d 100644
--- a/zh-cn/docs/producer_example.md
+++ b/zh-cn/docs/producer_example.md
@@ -7,8 +7,8 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
   - TubeSingleSessionFactory 在整个生命周期只会创建一个 session
   - TubeMultiSessionFactory 每次调用都会创建一个session
 
-### TubeSingleSessionFactory
-   #### Send Message Synchronously
+1. TubeSingleSessionFactory
+   - Send Message Synchronously
      ```java
      public final class SyncProducerExample {
     
@@ -28,10 +28,10 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
             }
             messageProducer.shutdown();
         }
-    }
-    ```
+     }
+     ```
      
-   #### Send Message Asynchronously
+   - Send Message Asynchronously
      ```java
      public final class AsyncProducerExample {
      
@@ -62,10 +62,10 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
             messageProducer.shutdown();
         }
 
-    }
-    ```
+     }
+     ```
      
-   #### Send Message With Attributes
+   - Send Message With Attributes
      ```java
      public final class ProducerWithAttributeExample {
      
@@ -87,11 +87,9 @@ TubeMQ提供了两种方式来初始化 session factory: TubeSingleSessionFactor
             messageProducer.sendMessage(message);
             messageProducer.shutdown();
         }
-
-    }
-    ```
+     }```
      
-### TubeMultiSessionFactory
+- TubeMultiSessionFactory
 
     ```java
     public class MultiSessionProducerExample {