incubator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yu...@apache.org
Subject [04/10] incubator-rocketmq-site git commit: Add content to git repo.
Date Sat, 24 Dec 2016 06:55:56 GMT
http://git-wip-us.apache.org/repos/asf/incubator-rocketmq-site/blob/5479307c/content/docs/motivation/index.html
----------------------------------------------------------------------
diff --git a/content/docs/motivation/index.html b/content/docs/motivation/index.html
new file mode 100644
index 0000000..b72f771
--- /dev/null
+++ b/content/docs/motivation/index.html
@@ -0,0 +1,511 @@
+<!doctype html>
+<html lang="en" class="no-js">
+  <head>
+    <meta charset="utf-8">
+
+<!-- begin SEO -->
+
+
+
+
+
+
+
+
+
+<title>Motivation - Apache RocketMQ</title>
+
+
+
+
+<meta name="description" content="In the early stages, we constructed our distributed
messaging middleware on the basis of ActiveMQ 5.x(less than 5.3). Our international business
uses it for async communication, search, social network activity stream, data pipeline, even
in our trade order process. As our trade business throughput rises more and more inconceivably,
pressure originating from our messaging cluster also become more and more obvious.">
+
+
+
+
+<meta property="og:locale" content="en">
+<meta property="og:site_name" content="Apache RocketMQ">
+<meta property="og:title" content="Motivation">
+
+
+
+
+  <meta property="og:description" content="In the early stages, we constructed our distributed
messaging middleware on the basis of ActiveMQ 5.x(less than 5.3). Our international business
uses it for async communication, search, social network activity stream, data pipeline, even
in our trade order process. As our trade business throughput rises more and more inconceivably,
pressure originating from our messaging cluster also become more and more obvious.">
+
+
+
+  <meta name="twitter:site" content="@ApacheRocketMQ">
+  <meta name="twitter:title" content="Motivation">
+  <meta name="twitter:description" content="In the early stages, we constructed our distributed
messaging middleware on the basis of ActiveMQ 5.x(less than 5.3). Our international business
uses it for async communication, search, social network activity stream, data pipeline, even
in our trade order process. As our trade business throughput rises more and more inconceivably,
pressure originating from our messaging cluster also become more and more obvious.">
+  <meta name="twitter:url" content="">
+
+  
+    <meta name="twitter:card" content="summary">
+    
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+
+  <meta property="og:type" content="article">
+  <meta property="article:published_time" content="2016-12-24T14:50:49+08:00">
+
+
+
+
+
+
+
+
+  <script type="application/ld+json">
+    {
+      "@context" : "http://schema.org",
+      "@type" : "Person",
+      "name" : "Apache RocketMQ",
+      "url" : null,
+      "sameAs" : null
+    }
+  </script>
+
+
+
+
+
+
+<!-- end SEO -->
+
+
+<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache RocketMQ
Feed">
+
+<!-- http://t.co/dKP3o1e -->
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<script>
+  document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g,
'') + ' js ';
+</script>
+
+<!-- For all browsers -->
+<link rel="stylesheet" href="/assets/css/main.css">
+
+<meta http-equiv="cleartype" content="on">
+    <!-- start custom head snippets -->
+
+<!-- insert favicons. use http://realfavicongenerator.net/ -->
+
+<!-- end custom head snippets -->
+  </head>
+
+  <body class="layout--single">
+
+    <!--[if lt IE 9]>
+<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong>
browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to
improve your experience.</div>
+<![endif]-->
+    <div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+        <button><div class="navicon"></div></button>
+        <ul class="visible-links">
+          <li class="masthead__menu-item masthead__menu-item--lg"><a href="/">Apache
RocketMQ</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/docs/quick-start/">Documentation</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/year-archive/">Blog</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/community/">Community</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/about/">About</a></li>
+          
+        </ul>
+        <ul class="hidden-links hidden"></ul>
+      </nav>
+    </div>
+  </div>
+</div>
+
+    
+
+
+
+<div id="main" role="main">
+  
+  <div class="sidebar sticky">
+  
+  
+    
+      
+      
+      
+    
+    
+      
+
+<nav class="nav__list">
+  
+  <input id="ac-toc" name="accordion-toc" type="checkbox" />
+  <label for="ac-toc">Toggle Menu</label>
+  <ul class="nav__items">
+    
+      <li>
+        
+          <span class="nav__sub-title">User Guide</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/quick-start/" class="">Quick Start</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="active">Motivation</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/core-concept/" class="">Core Concept</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cli-admin-tool/" class="">CLI Admin Tool</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Cluster Configuration
& Deployment</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">Developer Guide</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="active">Architecture &
Design</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="active">Communication Protocol</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/core-concept/" class="">Persistence</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cli-admin-tool/" class="">Replication</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Service Discovery
& Load Balance</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Message Filter</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">Best Practice</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="active">Broker</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="active">Producer</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/core-concept/" class="">Consumer</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cli-admin-tool/" class="">Virtualization</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Frequently Asked
Questions</a></li>
+          
+        </ul>
+        
+      </li>
+    
+  </ul>
+</nav>
+    
+  
+  </div>
+
+
+  <article class="page" itemscope itemtype="http://schema.org/CreativeWork">
+    <meta itemprop="headline" content="Motivation">
+    <meta itemprop="description" content="In the early stages, we constructed our distributed
messaging middleware on the basis of ActiveMQ 5.x(less than 5.3). Our international business
uses it for async communication, search, social network activity stream, data pipeline, even
in our trade order process. As our trade business throughput rises more and more inconceivably,
pressure originating from our messaging cluster also become more and more obvious.">
+    <meta itemprop="datePublished" content="December 24, 2016">
+    <meta itemprop="dateModified" content="December 17, 2016">
+
+    <div class="page__inner-wrap">
+      
+        <header>
+          <h1 class="page__title" itemprop="headline">Motivation
+</h1>
+          
+        </header>
+      
+
+      <section class="page__content" itemprop="text">
+        <p>In the early stages, we constructed our distributed messaging middleware
on the basis of ActiveMQ 5.x(less than 5.3). Our international business uses it for async
communication, search, social network activity stream, data pipeline, even in our trade order
process. As our trade business throughput rises more and more inconceivably, pressure originating
from our messaging cluster also become more and more obvious.</p>
+
+<aside class="sidebar__right">
+<nav class="toc">
+    <header><h4 class="nav__title"><i class="fa fa-file-text"></i>
On This Page</h4></header>
+<ul class="toc__menu" id="markdown-toc">
+  <li><a href="#why-rocketmq-" id="markdown-toc-why-rocketmq-">Why RocketMQ ?</a></li>
+  <li><a href="#rocketmq-vs-activemq-vs-kafka" id="markdown-toc-rocketmq-vs-activemq-vs-kafka">RocketMQ
vs. ActiveMQ vs. Kafka</a></li>
+</ul>
+
+  </nav>
+</aside>
+
+<h1 id="why-rocketmq-">Why RocketMQ ?</h1>
+
+<p>Based on our observations and research, with more and more queues and virtual topics
in use, ActiveMQ IO module becomes a bottleneck. In some cases, slower consumers can slow
down the producers. We tried our best efforts to handle this problems through throttling,
circuit breaker or degradation, but it cannot scale out gracefully. So we begin to focus on
the popular messaging solution Kafka at that time. Unfortunately, Kafka can not meet our requirements
such as low latency and high reliability, see <a href="https://github.com/alibaba/RocketMQ/wiki/how_to_support_more_queues">here</a>
for details.</p>
+
+<p>In this context, we decided to innovate a new messaging middleware to handle a broad
set of use cases, ranging from traditional publish/subscribe scenario to demandingly high
volume realtime transaction system that tolerates no message loss. We also created a cornerstone
product based on RocketMQ, a Platform as a Service (PaaS) product named the
+<a href="https://intl.aliyun.com/">Alibaba Cloud Platform</a>. Today, more than
100 companies are using the RocketMQ open source version in their business solutions. We believe
RocketMQ can benefit more people, so we would like to share it around the world.</p>
+
+<p>The following are some different design between RocketMQ, ActiveMQ and Kafka(They
are the apache’s most popular messaging solutions according to <a href="https://github.com/akullpp/awesome-java">awesome-java</a>):</p>
+
+<h1 id="rocketmq-vs-activemq-vs-kafka">RocketMQ vs. ActiveMQ vs. Kafka</h1>
+
+<table>
+  <thead>
+    <tr>
+      <th>Messaging Product</th>
+      <th>Client SDK</th>
+      <th>Protocol and Specification</th>
+      <th>Order Message</th>
+      <th>Message Filter</th>
+      <th>Server Triggered Redelivery</th>
+      <th>Persistent Message</th>
+      <th>Retroactive Consumers</th>
+      <th>Message Priority</th>
+      <th>High Availability and Failover</th>
+      <th>Message Track</th>
+      <th>Configuration</th>
+      <th>Management and Operation Tools</th>
+    </tr>
+  </thead>
+  <tbody>
+    <tr>
+      <td>ActiveMQ</td>
+      <td>Java, .NET, C++ etc.</td>
+      <td>Push model, support OpenWire, STOMP, AMQP, MQTT, JMS</td>
+      <td>Exclusive Consumer or Exclusive Queues can ensure ordering</td>
+      <td>Supported</td>
+      <td>Not Supported</td>
+      <td>Supports very fast persistence using JDBC along with a high performance journal,such
as levelDB, kahaDB</td>
+      <td>Supported</td>
+      <td>Supported</td>
+      <td>Supported, depending on storage,if using kahadb it requires a ZooKeeper server</td>
+      <td>Not Supported</td>
+      <td>The default configuration is low level, user need to optimize the configuration
parameters</td>
+      <td>Supported</td>
+    </tr>
+    <tr>
+      <td>Kafka</td>
+      <td>Java, Scala etc.</td>
+      <td>Pull model, support TCP</td>
+      <td>Ensure ordering of messages within a partition</td>
+      <td>Supported, you can use Kafka Streams to filter messages</td>
+      <td>Not Supported</td>
+      <td>High performance file storage</td>
+      <td>Supported offset indicate</td>
+      <td>Not Supported</td>
+      <td>Supported, requires a ZooKeeper server</td>
+      <td>Not Supported</td>
+      <td>Kafka uses key-value pairs format for configuration. These values can be
supplied either from a file or programmatically.</td>
+      <td>Supported, use terminal command to expose core metrics</td>
+    </tr>
+    <tr>
+      <td>RocketMQ</td>
+      <td>Java, .NET, C++</td>
+      <td>Pull model, support TCP, JMS</td>
+      <td>Ensure strict ordering of messages, have no hot spot problem,and can scale
out gracefully</td>
+      <td>Supported, you can even upload yourself custom-built filter code snippets</td>
+      <td>Supported</td>
+      <td>High performance and low latency file storage</td>
+      <td>Supported timestamp and offset 2 indicates</td>
+      <td>Not Supported</td>
+      <td>Supported, Master-Slave model, without another kit</td>
+      <td>Supported</td>
+      <td>Work out of box,user only need to pay attention to a few configurations</td>
+      <td>Supported, rich web and terminal command to expose core metrics</td>
+    </tr>
+  </tbody>
+</table>
+
+        
+      </section>
+
+      <footer class="page__meta">
+        
+        
+
+
+        
+          <p class="page__date"><strong><i class="fa fa-fw fa-calendar" aria-hidden="true"></i>
Updated:</strong> <time datetime="2016-12-17">December 17, 2016</time></p>
+        
+      </footer>
+
+      
+
+      
+  <nav class="pagination">
+    
+      <a href="/docs/quick-start/" class="pagination--pager" title="Quick Start
+">Previous</a>
+    
+    
+      <a href="/docs/core-concept/" class="pagination--pager" title="Core Concept
+">Next</a>
+    
+  </nav>
+
+    </div>
+
+    
+  </article>
+
+  
+  
+</div>
+
+    <div class="page__footer">
+      <footer>
+        <!-- start custom footer snippets -->
+
+<!-- end custom footer snippets -->
+        <div class="page__footer-follow">
+  <ul class="social-icons">
+    
+      <li><strong>Follow:</strong></li>
+    
+    
+      <li><a href="https://twitter.com/ApacheRocketMQ"><i class="fa fa-fw
fa-twitter-square" aria-hidden="true"></i> Twitter</a></li>
+    
+    
+    
+      <li><a href="http://github.com/alibaba/RocketMQ/"><i class="fa fa-fw
fa-github" aria-hidden="true"></i> GitHub</a></li>
+    
+    
+    <li><a href="/feed.xml"><i class="fa fa-fw fa-rss-square" aria-hidden="true"></i>
Feed</a></li>
+  </ul>
+</div>
+
+<div class="page__footer-copyright">Copyright &copy; 2016 <a href="http://www.apache.org/">The
Apache Software Foundation</a>. All Rights Reserved.</div>
+      </footer>
+    </div>
+
+    <script src="/assets/js/main.min.js"></script>
+
+
+
+
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq-site/blob/5479307c/content/docs/quick-start/index.html
----------------------------------------------------------------------
diff --git a/content/docs/quick-start/index.html b/content/docs/quick-start/index.html
new file mode 100644
index 0000000..600a478
--- /dev/null
+++ b/content/docs/quick-start/index.html
@@ -0,0 +1,561 @@
+<!doctype html>
+<html lang="en" class="no-js">
+  <head>
+    <meta charset="utf-8">
+
+<!-- begin SEO -->
+
+
+
+
+
+
+
+
+
+<title>Quick Start - Apache RocketMQ</title>
+
+
+
+
+<meta name="description" content="How to quickly install and setup Apache RocketMQ.">
+
+
+
+
+<meta property="og:locale" content="en">
+<meta property="og:site_name" content="Apache RocketMQ">
+<meta property="og:title" content="Quick Start">
+
+
+
+
+  <meta property="og:description" content="How to quickly install and setup Apache RocketMQ.">
+
+
+
+  <meta name="twitter:site" content="@ApacheRocketMQ">
+  <meta name="twitter:title" content="Quick Start">
+  <meta name="twitter:description" content="How to quickly install and setup Apache RocketMQ.">
+  <meta name="twitter:url" content="">
+
+  
+    <meta name="twitter:card" content="summary">
+    
+  
+
+  
+
+
+
+  
+
+  
+
+
+
+
+
+  <meta property="og:type" content="article">
+  <meta property="article:published_time" content="2016-12-24T14:50:49+08:00">
+
+
+
+
+
+
+
+
+  <script type="application/ld+json">
+    {
+      "@context" : "http://schema.org",
+      "@type" : "Person",
+      "name" : "Apache RocketMQ",
+      "url" : null,
+      "sameAs" : null
+    }
+  </script>
+
+
+
+
+
+
+<!-- end SEO -->
+
+
+<link href="/feed.xml" type="application/atom+xml" rel="alternate" title="Apache RocketMQ
Feed">
+
+<!-- http://t.co/dKP3o1e -->
+<meta name="HandheldFriendly" content="True">
+<meta name="MobileOptimized" content="320">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<script>
+  document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g,
'') + ' js ';
+</script>
+
+<!-- For all browsers -->
+<link rel="stylesheet" href="/assets/css/main.css">
+
+<meta http-equiv="cleartype" content="on">
+    <!-- start custom head snippets -->
+
+<!-- insert favicons. use http://realfavicongenerator.net/ -->
+
+<!-- end custom head snippets -->
+  </head>
+
+  <body class="layout--single">
+
+    <!--[if lt IE 9]>
+<div class="notice--danger align-center" style="margin: 0;">You are using an <strong>outdated</strong>
browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to
improve your experience.</div>
+<![endif]-->
+    <div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+        <button><div class="navicon"></div></button>
+        <ul class="visible-links">
+          <li class="masthead__menu-item masthead__menu-item--lg"><a href="/">Apache
RocketMQ</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/docs/quick-start/">Documentation</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/year-archive/">Blog</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/community/">Community</a></li>
+          
+            
+            <li class="masthead__menu-item"><a href="/about/">About</a></li>
+          
+        </ul>
+        <ul class="hidden-links hidden"></ul>
+      </nav>
+    </div>
+  </div>
+</div>
+
+    
+
+
+
+<div id="main" role="main">
+  
+  <div class="sidebar sticky">
+  
+  
+    
+      
+      
+      
+    
+    
+      
+
+<nav class="nav__list">
+  
+  <input id="ac-toc" name="accordion-toc" type="checkbox" />
+  <label for="ac-toc">Toggle Menu</label>
+  <ul class="nav__items">
+    
+      <li>
+        
+          <span class="nav__sub-title">User Guide</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/quick-start/" class="active">Quick Start</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="">Motivation</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/core-concept/" class="">Core Concept</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cli-admin-tool/" class="">CLI Admin Tool</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Cluster Configuration
& Deployment</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">Developer Guide</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="">Architecture & Design</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="">Communication Protocol</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/core-concept/" class="">Persistence</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cli-admin-tool/" class="">Replication</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Service Discovery
& Load Balance</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Message Filter</a></li>
+          
+        </ul>
+        
+      </li>
+    
+      <li>
+        
+          <span class="nav__sub-title">Best Practice</span>
+        
+
+        
+        <ul>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="">Broker</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/motivation/" class="">Producer</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/core-concept/" class="">Consumer</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cli-admin-tool/" class="">Virtualization</a></li>
+          
+            
+            
+
+            
+            
+
+            <li><a href="/docs/cluster-deployment/" class="">Frequently Asked
Questions</a></li>
+          
+        </ul>
+        
+      </li>
+    
+  </ul>
+</nav>
+    
+  
+  </div>
+
+
+  <article class="page" itemscope itemtype="http://schema.org/CreativeWork">
+    <meta itemprop="headline" content="Quick Start">
+    <meta itemprop="description" content="How to quickly install and setup Apache RocketMQ.">
+    <meta itemprop="datePublished" content="December 24, 2016">
+    <meta itemprop="dateModified" content="December 17, 2016">
+
+    <div class="page__inner-wrap">
+      
+        <header>
+          <h1 class="page__title" itemprop="headline">Quick Start
+</h1>
+          
+        </header>
+      
+
+      <section class="page__content" itemprop="text">
+        <p>This quick start guide is to give detailed instructions, helping you setup
RocketMQ messaging system on a single local machine and send/receive the very first message.</p>
+
+<aside class="sidebar__right">
+<nav class="toc">
+    <header><h4 class="nav__title"><i class="fa fa-file-text"></i>
On This Page</h4></header>
+<ul class="toc__menu" id="markdown-toc">
+  <li><a href="#prerequisite" id="markdown-toc-prerequisite">Prerequisite</a></li>
+  <li><a href="#clone--build" id="markdown-toc-clone--build">Clone &amp;
Build</a></li>
+  <li><a href="#start-name-server" id="markdown-toc-start-name-server">Start
Name Server</a></li>
+  <li><a href="#start-broker" id="markdown-toc-start-broker">Start Broker</a></li>
+  <li><a href="#send--receive-messages" id="markdown-toc-send--receive-messages">Send
&amp; Receive Messages</a></li>
+  <li><a href="#code-example" id="markdown-toc-code-example">Code Example</a>
   <ul>
+      <li><a href="#prepare" id="markdown-toc-prepare">prepare</a></li>
+      <li><a href="#producer" id="markdown-toc-producer">Producer</a></li>
+      <li><a href="#consumer" id="markdown-toc-consumer">Consumer</a></li>
+    </ul>
+  </li>
+</ul>
+
+  </nav>
+</aside>
+
+<h1 id="prerequisite">Prerequisite</h1>
+
+<p>The following softwares are assumed installed:</p>
+<ol>
+  <li>64bit OS, best to have Linux/Unix/Mac;</li>
+  <li>64bit JDK 1.7+;</li>
+  <li>Maven 3.2.x</li>
+  <li>Git</li>
+</ol>
+
+<h1 id="clone--build">Clone &amp; Build</h1>
+
+<div class="language-shell highlighter-rouge"><pre class="highlight"><code>
 &gt; git clone https://github.com/alibaba/RocketMQ.git
+  &gt; <span class="nb">cd </span>RocketMQ
+  &gt; sh install.sh
+  &gt; <span class="nb">cd </span>devenv
+</code></pre>
+</div>
+
+<h1 id="start-name-server">Start Name Server</h1>
+<div class="language-shell highlighter-rouge"><pre class="highlight"><code>
 &gt; nohup sh bin/mqnamesrv &amp;
+  &gt; tail -f ~/logs/rocketmqlogs/namesrv.log
+  The Name Server boot success...
+</code></pre>
+</div>
+
+<h1 id="start-broker">Start Broker</h1>
+<div class="language-shell highlighter-rouge"><pre class="highlight"><code>
 &gt; nohup sh bin/mqbroker -n localhost:9876 &amp;
+  &gt; tail -f ~/logs/rocketmqlogs/broker.log 
+  The broker[%s, 172.30.30.233:10911] boot success...
+</code></pre>
+</div>
+<p>you may need to pay attention to the broker ip, for that the broker will not use
the loopback network interface, So you should make sure you have connected to other network.</p>
+
+<h1 id="send--receive-messages">Send &amp; Receive Messages</h1>
+
+<p>Before sending/receiving messages, we need to tell clients where name servers are
located. RocketMQ provides multiple ways to achieve this. For simplicity, we use environment
variable <code class="highlighter-rouge">NAMESRV_ADDR</code></p>
+
+<div class="language-shell highlighter-rouge"><pre class="highlight"><code>
&gt; <span class="nb">export </span><span class="nv">NAMESRV_ADDR</span><span
class="o">=</span>localhost:9876
+ &gt; sh bin/tools.sh com.alibaba.rocketmq.example.quickstart.Producer
+ SendResult <span class="o">[</span><span class="nv">sendStatus</span><span
class="o">=</span>SEND_OK, <span class="nv">msgId</span><span class="o">=</span>
...
+
+ &gt; sh bin/tools.sh com.alibaba.rocketmq.example.quickstart.Consumer
+ ConsumeMessageThread_%d Receive New Messages: <span class="o">[</span>MessageExt...
+</code></pre>
+</div>
+
+<h1 id="code-example">Code Example</h1>
+
+<h2 id="prepare">prepare</h2>
+<div class="highlighter-rouge"><pre class="highlight"><code>&lt;dependency&gt;
+    &lt;groupId&gt;com.alibaba.rocketmq&lt;/groupId&gt;
+    &lt;artifactId&gt;rocketmq-client&lt;/artifactId&gt;
+    &lt;version&gt;3.5.8&lt;/version&gt;
+&lt;/dependency&gt;
+</code></pre>
+</div>
+
+<h2 id="producer">Producer</h2>
+
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span
class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.exception.MQClientException</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.producer.DefaultMQProducer</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.producer.SendResult</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.common.message.Message</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.remoting.common.RemotingHelper</span><span
class="o">;</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">Producer</span> <span class="o">{</span> 
+    <span class="kd">public</span> <span class="kd">static</span>
<span class="kt">void</span> <span class="nf">main</span><span
class="o">(</span><span class="n">String</span><span class="o">[]</span>
<span class="n">args</span><span class="o">)</span> <span class="kd">throws</span>
<span class="n">MQClientException</span><span class="o">,</span> <span
class="n">InterruptedException</span> <span class="o">{</span>
+        <span class="n">DefaultMQProducer</span> <span class="n">producer</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">DefaultMQProducer</span><span
class="o">(</span><span class="s">"YOUR_PRODUCER_GROUP"</span><span
class="o">);</span> <span class="c1">// (1)</span>
+        <span class="n">producer</span><span class="o">.</span><span
class="na">setNamesrvAddr</span><span class="o">(</span><span class="s">"localhost:9876"</span><span
class="o">);</span> <span class="c1">//(2) set name server explicitly</span>
+        <span class="n">producer</span><span class="o">.</span><span
class="na">start</span><span class="o">();</span> <span class="c1">//
(3)</span>
+        <span class="k">for</span> <span class="o">(</span><span
class="kt">int</span> <span class="n">i</span> <span class="o">=</span>
<span class="mi">0</span><span class="o">;</span> <span class="n">i</span>
<span class="o">&lt;</span> <span class="mi">1000</span><span
class="o">;</span> <span class="n">i</span><span class="o">++)</span>
<span class="o">{</span>
+            <span class="k">try</span> <span class="o">{</span>
+                <span class="n">Message</span> <span class="n">msg</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">Message</span><span
class="o">(</span><span class="s">"TopicTest"</span><span class="o">,</span><span
class="c1">// topic // (4)</span>
+                        <span class="s">"TagA"</span><span class="o">,</span><span
class="c1">// tag (5)</span>
+                        <span class="o">(</span><span class="s">"Hello
RocketMQ "</span> <span class="o">+</span> <span class="n">i</span><span
class="o">).</span><span class="na">getBytes</span><span class="o">(</span><span
class="n">RemotingHelper</span><span class="o">.</span><span class="na">DEFAULT_CHARSET</span><span
class="o">)</span><span class="c1">// body (6)</span>
+                        <span class="o">);</span>
+                <span class="n">SendResult</span> <span class="n">sendResult</span>
<span class="o">=</span> <span class="n">producer</span><span class="o">.</span><span
class="na">send</span><span class="o">(</span><span class="n">msg</span><span
class="o">);</span> <span class="c1">// (7)</span>
+                <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span class="na">println</span><span
class="o">(</span><span class="n">sendResult</span><span class="o">);</span>
+            <span class="o">}</span> <span class="k">catch</span>
<span class="o">(</span><span class="n">Exception</span> <span
class="n">e</span><span class="o">)</span> <span class="o">{</span>
+                <span class="n">e</span><span class="o">.</span><span
class="na">printStackTrace</span><span class="o">();</span>
+                <span class="n">Thread</span><span class="o">.</span><span
class="na">sleep</span><span class="o">(</span><span class="mi">1000</span><span
class="o">);</span>
+            <span class="o">}</span>
+        <span class="o">}</span>
+        <span class="n">producer</span><span class="o">.</span><span
class="na">shutdown</span><span class="o">();</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+<h2 id="consumer">Consumer</h2>
+
+<div class="language-java highlighter-rouge"><pre class="highlight"><code><span
class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.consumer.DefaultMQPushConsumer</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.consumer.listener.MessageListenerConcurrently</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.client.exception.MQClientException</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.common.consumer.ConsumeFromWhere</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">com.alibaba.rocketmq.common.message.MessageExt</span><span
class="o">;</span>
+<span class="kn">import</span> <span class="nn">java.util.List</span><span
class="o">;</span>
+
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">Consumer</span> <span class="o">{</span>
+    <span class="kd">public</span> <span class="kd">static</span>
<span class="kt">void</span> <span class="nf">main</span><span
class="o">(</span><span class="n">String</span><span class="o">[]</span>
<span class="n">args</span><span class="o">)</span> <span class="kd">throws</span>
<span class="n">InterruptedException</span><span class="o">,</span>
<span class="n">MQClientException</span> <span class="o">{</span>
+        <span class="n">DefaultMQPushConsumer</span> <span class="n">consumer</span>
<span class="o">=</span> <span class="k">new</span> <span class="n">DefaultMQPushConsumer</span><span
class="o">(</span><span class="s">"YOUR_CONSUMER_GROUP"</span><span
class="o">);</span> <span class="c1">// (1)</span>
+        <span class="n">consumer</span><span class="o">.</span><span
class="na">setNamesrvAddr</span><span class="o">(</span><span class="s">"localhost:9876"</span><span
class="o">);</span> <span class="c1">// (2)</span>
+        <span class="n">consumer</span><span class="o">.</span><span
class="na">subscribe</span><span class="o">(</span><span class="s">"TopicTest"</span><span
class="cm">/*topic*/</span><span class="o">,</span> <span class="s">"*"</span><span
class="cm">/*tag,* means all tags*/</span><span class="o">);</span> <span
class="c1">// (3)</span>
+        <span class="n">consumer</span><span class="o">.</span><span
class="na">setConsumeFromWhere</span><span class="o">(</span><span
class="n">ConsumeFromWhere</span><span class="o">.</span><span class="na">CONSUME_FROM_FIRST_OFFSET</span><span
class="o">);</span> <span class="c1">// (4)</span>
+        <span class="n">consumer</span><span class="o">.</span><span
class="na">registerMessageListener</span><span class="o">(</span><span
class="k">new</span> <span class="n">MessageListenerConcurrently</span><span
class="o">()</span> <span class="o">{</span>
+                    <span class="nd">@Override</span>
+                    <span class="kd">public</span> <span class="n">ConsumeConcurrentlyStatus</span>
<span class="nf">consumeMessage</span><span class="o">(</span><span
class="n">List</span><span class="o">&lt;</span><span class="n">MessageExt</span><span
class="o">&gt;</span> <span class="n">msgs</span><span class="o">,</span>
<span class="n">ConsumeConcurrentlyContext</span> <span class="n">context</span><span
class="o">)</span> <span class="o">{</span>
+                        <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span class="na">println</span><span
class="o">(</span><span class="n">Thread</span><span class="o">.</span><span
class="na">currentThread</span><span class="o">().</span><span class="na">getName</span><span
class="o">()</span> <span class="o">+</span> <span class="s">"
Receive New Messages: "</span> <span class="o">+</span> <span class="n">msgs</span><span
class="o">);</span>
+                        <span class="k">return</span> <span class="n">ConsumeConcurrentlyStatus</span><span
class="o">.</span><span class="na">CONSUME_SUCCESS</span><span class="o">;</span>
+                    <span class="o">}</span>
+                <span class="o">});</span> <span class="c1">//(5)</span>
+        <span class="n">consumer</span><span class="o">.</span><span
class="na">start</span><span class="o">();</span> <span class="c1">//(6)</span>
+        <span class="n">System</span><span class="o">.</span><span
class="na">out</span><span class="o">.</span><span class="na">println</span><span
class="o">(</span><span class="s">"Consumer Started."</span><span
class="o">);</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</code></pre>
+</div>
+
+        
+      </section>
+
+      <footer class="page__meta">
+        
+        
+
+
+        
+          <p class="page__date"><strong><i class="fa fa-fw fa-calendar" aria-hidden="true"></i>
Updated:</strong> <time datetime="2016-12-17">December 17, 2016</time></p>
+        
+      </footer>
+
+      
+
+      
+  <nav class="pagination">
+    
+      <a href="#" class="pagination--pager disabled">Previous</a>
+    
+    
+      <a href="/docs/motivation/" class="pagination--pager" title="Motivation
+">Next</a>
+    
+  </nav>
+
+    </div>
+
+    
+  </article>
+
+  
+  
+</div>
+
+    <div class="page__footer">
+      <footer>
+        <!-- start custom footer snippets -->
+
+<!-- end custom footer snippets -->
+        <div class="page__footer-follow">
+  <ul class="social-icons">
+    
+      <li><strong>Follow:</strong></li>
+    
+    
+      <li><a href="https://twitter.com/ApacheRocketMQ"><i class="fa fa-fw
fa-twitter-square" aria-hidden="true"></i> Twitter</a></li>
+    
+    
+    
+      <li><a href="http://github.com/alibaba/RocketMQ/"><i class="fa fa-fw
fa-github" aria-hidden="true"></i> GitHub</a></li>
+    
+    
+    <li><a href="/feed.xml"><i class="fa fa-fw fa-rss-square" aria-hidden="true"></i>
Feed</a></li>
+  </ul>
+</div>
+
+<div class="page__footer-copyright">Copyright &copy; 2016 <a href="http://www.apache.org/">The
Apache Software Foundation</a>. All Rights Reserved.</div>
+      </footer>
+    </div>
+
+    <script src="/assets/js/main.min.js"></script>
+
+
+
+
+
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq-site/blob/5479307c/content/favicon.ico
----------------------------------------------------------------------
diff --git a/content/favicon.ico b/content/favicon.ico
new file mode 100644
index 0000000..e3e2b10
Binary files /dev/null and b/content/favicon.ico differ


Mime
View raw message