http://git-wip-us.apache.org/repos/asf/incubator-rocketmq-site/blob/af2718af/content/docs/faq/index.html
----------------------------------------------------------------------
diff --cc content/docs/faq/index.html
index c9de84f,0000000..9d56887
mode 100644,000000..100644
--- a/content/docs/faq/index.html
+++ b/content/docs/faq/index.html
@@@ -1,703 -1,0 +1,703 @@@
 +<!doctype html>
 +<html lang="en" class="no-js">
 +  <head>
 +    <meta charset="utf-8">
 +
 +<!-- begin SEO -->
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +<title>Frequently Asked Questions - Apache RocketMQ</title>
 +
 +
 +
 +
 +<meta name="description" content="The following questions are frequently 
asked with regard to the RocketMQ project in general.General1. Why did we 
create rocketmq project instead of selecting other products?Please refer to Why 
RocketMQ">
 +
 +
 +
 +
 +<meta property="og:locale" content="en">
 +<meta property="og:site_name" content="Apache RocketMQ">
 +<meta property="og:title" content="Frequently Asked Questions">
 +
 +
 +
 +
 +  <meta property="og:description" content="The following questions are 
frequently asked with regard to the RocketMQ project in general.General1. Why 
did we create rocketmq project instead of selecting other products?Please refer 
to Why RocketMQ">
 +
 +
 +
 +  <meta name="twitter:site" content="@ApacheRocketMQ">
 +  <meta name="twitter:title" content="Frequently Asked Questions">
 +  <meta name="twitter:description" content="The following questions are 
frequently asked with regard to the RocketMQ project in general.General1. Why 
did we create rocketmq project instead of selecting other products?Please refer 
to Why RocketMQ">
 +  <meta name="twitter:url" content="">
 +
 +  
 +    <meta name="twitter:card" content="summary">
 +    
 +  
 +
 +  
 +
 +
 +
 +  
 +
 +  
 +
 +
 +
 +
 +
 +  <meta property="og:type" content="article">
-   <meta property="article:published_time" content="2017-06-08T17:34:10+08:00">
++  <meta property="article:published_time" content="2017-06-08T18:09:33+08:00">
 +
 +
 +
 +
 +
 +
 +
 +
 +  <script type="application/ld+json">
 +    {
 +      "@context" : "http://schema.org";,
 +      "@type" : "Person",
 +      "name" : "Apache RocketMQ",
 +      "url" : null,
 +      "sameAs" : null
 +    }
 +  </script>
 +
 +
 +
 +  <meta name="google-site-verification" 
content="aand0XZkSGsziuC-UPD4ZJniFD0m0JhGx6820y2mAQY" />
 +
 +
 +  <meta name="baidu-site-verification" content="wD06EbDRkQ" />
 +
 +
 +
 +
 +<!-- 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="/customer/">Customer</a></li>
 +          
 +            
 +            <li class="masthead__menu-item"><a 
href="/about/team/">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/motivation/" class="">Why RocketMQ</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/quick-start/" class="">Quick Start</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/simple-example/" class="">Simple 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/order-example/" class="">Order Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/broadcast-example/" class="">Broadcasting 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/schedule-example/" class="">Schedule 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/batch-example/" class="">Batch Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/filter-by-sql92-example/" class="">Filter 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/faq/" class="active">FAQ</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Deployment & Operations</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/rmq-arc/" class="">Architecture</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/rmq-deployment/" class="">Deployment</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/cli-admin-tool/" class="">CLI Admin 
Tool</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Contributor Guide</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/code-guidelines/" class="">Code 
Guidelines</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/pull-request/" class="">Manage Pull 
Request</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/release-manual" class="">Release 
Manual</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Best Practice</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/core-concept/" class="">Core Concept</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-broker/" class="">Broker</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-producer/" 
class="">Producer</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-consumer/" 
class="">Consumer</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-namesvr/" 
class="">NameServer</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Release Notes</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/dowloading/releases/" class="">Download</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/release_notes/release-notes-4.0.0-incubating/" 
class="">4.0.0-incubating</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          
 +          
 +
 +          <a href="/docs/roadmap/"><span 
class="nav__sub-title">RoadMap</span></a>
 +        
 +
 +        
 +      </li>
 +    
 +  </ul>
 +</nav>
 +    
 +  
 +  </div>
 +
 +
 +  <article class="page" itemscope itemtype="http://schema.org/CreativeWork";>
 +    <meta itemprop="headline" content="Frequently Asked Questions">
 +    <meta itemprop="description" content="The following questions are 
frequently asked with regard to the RocketMQ project in general.General1. Why 
did we create rocketmq project instead of selecting other products?Please refer 
to Why RocketMQ">
 +    <meta itemprop="datePublished" content="June 08, 2017">
 +    <meta itemprop="dateModified" content="December 27, 2016">
 +
 +    <div class="page__inner-wrap">
 +      
 +        <header>
 +          <h1 class="page__title" itemprop="headline">Frequently Asked 
Questions
 +</h1>
 +          
 +        </header>
 +      
 +
 +      <section class="page__content" itemprop="text">
 +        <p>The following questions are frequently asked with regard to the 
RocketMQ project in general.</p>
 +
 +<h2 id="general">General</h2>
 +<h3 
id="1-why-did-we-create-rocketmq-project-instead-of-selecting-other-products">1.
 Why did we create rocketmq project instead of selecting other products?</h3>
 +<p>Please refer to <a href="/docs/motivation/">Why RocketMQ</a></p>
 +
 +<h3 
id="2-do-i-have-to-install-other-softewares-such-as-zookeeper-to-use-rocketmq">2.
 Do I have to install other softewares, such as zookeeper, to use RocketMQ?</h3>
 +<p>No. RocketMQ can run independently.</p>
 +
 +<h2 id="usage">Usage</h2>
 +<h3 
id="1-where-does-the-newly-created-consumer-id-start-consuming-messages">1. 
Where does the newly created Consumer ID start consuming messages?</h3>
 +
 +<ol>
 +  <li>If the topic sends a message within three days, then the consumer start 
consuming messages from the first message saved in the server.</li>
 +  <li>If the topic sends a message three days ago, the consumer starts to 
consume messages from the latest message in the server, in other words, 
starting from the tail of message queue.</li>
 +  <li>If such consumer is rebooted, then it starts to consume messages from 
the last consumption location.</li>
 +</ol>
 +
 +<h3 id="2-how-to-reconsume-message-when-consumption-fails">2. How to 
reconsume message when consumption fails?</h3>
 +
 +<ol>
 +  <li>
 +    <p>Cluster consumption pattern
 +The consumer business logic code returns Action.ReconsumerLater, NULL, or 
throws an exception, if a message failed to be consumed, it will retry for up 
to 16 times, after that, the message would be descarded.</p>
 +  </li>
 +  <li>
 +    <p>Broadcast consumption pattern
 +The broadcaset consumption still ensures that a message is consumered at 
least once, but no resend option is provided.</p>
 +  </li>
 +</ol>
 +
 +<h3 
id="3-how-to-query-the-failed-message-if-there-is-a-consumption-failure">3. How 
to query the failed message if there is a consumption failure?</h3>
 +
 +<ol>
 +  <li>Using topic query by time, you can query messages within a period of 
time.</li>
 +  <li>Using Topic and Message Id to accurately query the message.</li>
 +  <li>Using Topic and Message Key accurately query a class of messages with 
the same Message Key.</li>
 +</ol>
 +
 +<h3 id="4-are-messages-delivered-exactly-once">4. Are messages delivered 
exactly once?</h3>
 +
 +<p>RocketMQ ensures that all messages are delivered at least once. In most 
cases, the messages are not repeated.</p>
 +
 +<h3 id="5-how-to-add-a-new-broker">5. How to add a new broker?</h3>
 +
 +<ol>
 +  <li>Start up a new broker and register it to the same list of name 
servers.</li>
 +  <li>By default, only internal system topics and consumer groups are created 
automatically. If you would like to have your business topic and consumer 
groups on the new node, please replicate them from the existing broker. Admin 
tool and command lines are provided to handle this.</li>
 +</ol>
 +
 +<h2 id="configuration-related">Configuration related</h2>
 +<p>The following answers are all default values and can be modified by 
configuration.</p>
 +<h3 id="1-how-long-are-the-messages-saved-on-the-server">1. How long are the 
messages saved on the server?</h3>
 +
 +<p>Stored messages are will be saved for up to 3 days, and messages that are 
not consumed for more than 3 days will be deleted.</p>
 +
 +<h3 id="2-what-is-the-size-limit-for-message-body">2. What is the size limit 
for message Body?</h3>
 +<p>Generally 256KB.</p>
 +
 +<h3 id="3-how-to-set-the-number-of-consumer-threads">3. How to set the number 
of consumer threads?</h3>
 +<p>When you start Consumer, set a ConsumeThreadNums property, example is as 
follows:</p>
 +
 +<div class="highlighter-rouge"><pre 
class="highlight"><code>consumer.setConsumeThreadMin(20);
 +consumer.setConsumeThreadMax(20);
 +</code></pre>
 +</div>
 +
 +<h2 id="errors">Errors</h2>
 +<h3 
id="1-if-you-start-a-producer-or-consumer-failed-and-the-error-message-is-producer-group-or-consumer-repeat">1.
 If you start a producer or consumer failed and the error message is producer 
group or consumer repeat?</h3>
 +<p>Reason:Using the same Producer /Consumer Group to launch multiple 
instances of Producer/Consumer in the same JVM may cause the client fail to 
start.</p>
 +
 +<p>Solution: Make sure that a JVM corresponding to one Producer /Consumer 
Group starts only with one Producer/Consumer instance.</p>
 +
 +<h3 id="2-if-consumer-failed-to-start-loading-json-file-in-broadcast-mode">2. 
If consumer failed to start loading json file in broadcast mode?</h3>
 +<p>Reason: Fastjson version is too low to allow the broadcast consumer to 
load local offsets.json, causing the consumer boot failure. Damaged fastjson 
file can also cause the same problem.</p>
 +
 +<p>Solution: Fastjson version has to be upgraded to rocketmq client dependent 
version to ensure that the local offsets.json can be loaded. By default 
offsets.json file is in /home/{user}/.rocketmq_offsets. Or check the integrity 
of fastjson.</p>
 +
 +<h3 id="3-what-is-the-impact-of-a-broker-crash">3. What is the impact of a 
broker crash?</h3>
 +
 +<ol>
 +  <li>Master crashes</li>
 +</ol>
 +
 +<p>Messages can no longer be sent to this broker set, but if you have another 
broker set available, messages can still be sent given the topic is present. 
Messages can still be consumed from slaves.</p>
 +
 +<ol>
 +  <li>Some slave crash</li>
 +</ol>
 +
 +<p>As long as there is another working slave, there will be no impact on 
sending messages. There will also be no impact on consuming messages except 
when the consumer group is set to consume from this slave preferably. By 
default, comsumer group consumes from master.</p>
 +
 +<ol>
 +  <li>All slaves crash</li>
 +</ol>
 +
 +<p>There will be no impact on sending messages to master, but, if the master 
is SYNC_MASTER, producer will get a SLAVE_NOT_AVAILABLE indicating that the 
message is not sent to any slaves. There will also be no impact on consuming 
messages except that if the consumer group is set to consume from slave 
preferably. By default, comsumer group consumes from master.</p>
 +
 +<h3 id="4-producer-complains-no-topic-route-info-how-to-diagnose">4. Producer 
complains “No Topic Route Info”, how to diagnose?</h3>
 +<p>This happens when you are trying to send messages to a topic whose routing 
info is not available to the producer.</p>
 +
 +<ol>
 +  <li>Make sure that the producer can connect to a name server and is capable 
of fetching routing meta info from it.</li>
 +  <li>Make sure that name servers do contain routing meta info of the topic. 
You may query the routing meta info from name server through topicRoute using 
admin tools or web console.</li>
 +  <li>Make sure that your brokers are sending heartbeats to the same list of 
name servers your producer is connecting to.</li>
 +  <li>Make sure that the topic’s permssion is 6(rw-), or at least 
2(-w-).</li>
 +</ol>
 +
 +<p>If you can’t find this topic, create it on a broker via admin tools 
command updateTopic or web console.</p>
 +
 +        
 +      </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-27">December 
27, 2016</time></p>
 +        
 +      </footer>
 +
 +      <section class="page__share">
 +  
 +    <h4 class="page__share-title">Share on</h4>
 +  
 +
 +  <a 
href="https://twitter.com/intent/tweet?via=ApacheRocketMQ&text=Frequently Asked 
Questions /docs/faq/" class="btn btn--twitter" title="Share on Twitter"><i 
class="fa fa-fw fa-twitter" aria-hidden="true"></i><span> Twitter</span></a>
 +
 +  <a href="https://www.facebook.com/sharer/sharer.php?u=/docs/faq/"; 
class="btn btn--facebook" title="Share on Facebook"><i class="fa fa-fw 
fa-facebook" aria-hidden="true"></i><span> Facebook</span></a>
 +
 +  <a href="https://plus.google.com/share?url=/docs/faq/"; class="btn 
btn--google-plus" title="Share on Google Plus"><i class="fa fa-fw 
fa-google-plus" aria-hidden="true"></i><span> Google+</span></a>
 +
 +  <a href="https://www.linkedin.com/shareArticle?mini=true&url=/docs/faq/"; 
class="btn btn--linkedin" title="Share on LinkedIn"><i class="fa fa-fw 
fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
 +</section>
 +
 +
 +      
 +  <nav class="pagination">
 +    
 +      <a href="/docs/documentation/" class="pagination--pager" 
title="Documentation
 +">Previous</a>
 +    
 +    
 +      <a href="/docs/release-manual" class="pagination--pager" title="Release 
Manual
 +">Next</a>
 +    
 +  </nav>
 +
 +    </div>
 +
 +    
 +      <div class="page__comments">
 +  
 +  
 +    <h4 class="page__comments-title">Leave a Comment</h4>
 +    <section id="disqus_thread"></section>
 +  
 +</div>
 +    
 +  </article>
 +
 +  
 +  
 +</div>
 +
 +    <div class="page__footer">
 +      <footer>
 +        <!-- start custom footer snippets -->
 +
 +<!-- end custom footer snippets -->
 +        <style type="text/css">
 +  div.columns   { float: left; margin-left: 10px;}
 +  div.clear     { clear: both; } 
 +</style>
 +<div>
 +  <div class="columns">
 +    <a href="https://www.apache.org/";><img 
src="/assets/images/feather-small.gif" alt="Apache Software Foundation" 
style="height: 88px !important" /></a>
 +  </div>
 +  <div class="columns" style="width: 80%">
 +    <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/apache/incubator-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; 2017 <a 
href="http://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</div>
 +  </div>
 +</div>
 +<div class="clear"></div>
 +      </footer>
 +    </div>
 +
 +    <script src="/assets/js/main.min.js"></script>
 +
 +
 +
 +
 +  <script>
 +  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 +  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
 +  
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 +  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 +
 +  ga('create', 'UA-89603173-1', 'auto');
 +  ga('send', 'pageview');
 +</script>
 +
 +<script>
 +var _hmt = _hmt || [];
 +(function() {
 +  var hm = document.createElement("script");
 +  hm.src = "https://hm.baidu.com/hm.js?36428f2b841d08e7405724cbf7f860d2";;
 +  var s = document.getElementsByTagName("script")[0]; 
 +  s.parentNode.insertBefore(hm, s);
 +})();
 +</script>
 +
 +
 +
 +
 +  
 +  <script type="text/javascript">
 +      /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * 
* */
 +      var disqus_shortname = 'rocketmq';
 +
 +      /* * * DON'T EDIT BELOW THIS LINE * * */
 +      (function() {
 +              var dsq = document.createElement('script'); dsq.type = 
'text/javascript'; dsq.async = true;
 +              dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
 +              (document.getElementsByTagName('head')[0] || 
document.getElementsByTagName('body')[0]).appendChild(dsq);
 +      })();
 +
 +      /* * * DON'T EDIT BELOW THIS LINE * * */
 +      (function () {
 +              var s = document.createElement('script'); s.async = true;
 +              s.type = 'text/javascript';
 +              s.src = '//' + disqus_shortname + '.disqus.com/count.js';
 +              (document.getElementsByTagName('HEAD')[0] || 
document.getElementsByTagName('BODY')[0]).appendChild(s);
 +      }());
 +  </script>
 +  <noscript>Please enable JavaScript to view the <a 
href="http://disqus.com/?ref_noscript";>comments powered by 
Disqus.</a></noscript>
 +
 +
 +
 +
 +
 +
 +  </body>
 +</html>

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq-site/blob/af2718af/content/docs/filter-by-sql92-example/index.html
----------------------------------------------------------------------
diff --cc content/docs/filter-by-sql92-example/index.html
index e607c7e,0000000..49e5260
mode 100644,000000..100644
--- a/content/docs/filter-by-sql92-example/index.html
+++ b/content/docs/filter-by-sql92-example/index.html
@@@ -1,703 -1,0 +1,703 @@@
 +<!doctype html>
 +<html lang="en" class="no-js">
 +  <head>
 +    <meta charset="utf-8">
 +
 +<!-- begin SEO -->
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +<title>Filter Example  - Apache RocketMQ</title>
 +
 +
 +
 +
 +<meta name="description" content="How to filter messages by SQL92 in Apache 
RocketMQ.">
 +
 +
 +
 +
 +<meta property="og:locale" content="en">
 +<meta property="og:site_name" content="Apache RocketMQ">
 +<meta property="og:title" content="Filter Example">
 +
 +
 +
 +
 +  <meta property="og:description" content="How to filter messages by SQL92 in 
Apache RocketMQ.">
 +
 +
 +
 +  <meta name="twitter:site" content="@ApacheRocketMQ">
 +  <meta name="twitter:title" content="Filter Example">
 +  <meta name="twitter:description" content="How to filter messages by SQL92 
in 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="2017-06-08T17:34:10+08:00">
++  <meta property="article:published_time" content="2017-06-08T18:09:33+08:00">
 +
 +
 +
 +
 +
 +
 +
 +
 +  <script type="application/ld+json">
 +    {
 +      "@context" : "http://schema.org";,
 +      "@type" : "Person",
 +      "name" : "Apache RocketMQ",
 +      "url" : null,
 +      "sameAs" : null
 +    }
 +  </script>
 +
 +
 +
 +  <meta name="google-site-verification" 
content="aand0XZkSGsziuC-UPD4ZJniFD0m0JhGx6820y2mAQY" />
 +
 +
 +  <meta name="baidu-site-verification" content="wD06EbDRkQ" />
 +
 +
 +
 +
 +<!-- 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="/customer/">Customer</a></li>
 +          
 +            
 +            <li class="masthead__menu-item"><a 
href="/about/team/">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/motivation/" class="">Why RocketMQ</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/quick-start/" class="">Quick Start</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/simple-example/" class="">Simple 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/order-example/" class="">Order Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/broadcast-example/" class="">Broadcasting 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/schedule-example/" class="">Schedule 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/batch-example/" class="">Batch Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/filter-by-sql92-example/" 
class="active">Filter Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/faq/" class="">FAQ</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Deployment & Operations</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/rmq-arc/" class="">Architecture</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/rmq-deployment/" class="">Deployment</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/cli-admin-tool/" class="">CLI Admin 
Tool</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Contributor Guide</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/code-guidelines/" class="">Code 
Guidelines</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/pull-request/" class="">Manage Pull 
Request</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/release-manual" class="">Release 
Manual</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Best Practice</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/core-concept/" class="">Core Concept</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-broker/" class="">Broker</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-producer/" 
class="">Producer</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-consumer/" 
class="">Consumer</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-namesvr/" 
class="">NameServer</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Release Notes</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/dowloading/releases/" class="">Download</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/release_notes/release-notes-4.0.0-incubating/" 
class="">4.0.0-incubating</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          
 +          
 +
 +          <a href="/docs/roadmap/"><span 
class="nav__sub-title">RoadMap</span></a>
 +        
 +
 +        
 +      </li>
 +    
 +  </ul>
 +</nav>
 +    
 +  
 +  </div>
 +
 +
 +  <article class="page" itemscope itemtype="http://schema.org/CreativeWork";>
 +    <meta itemprop="headline" content="Filter Example">
 +    <meta itemprop="description" content="How to filter messages by SQL92 in 
Apache RocketMQ.">
 +    <meta itemprop="datePublished" content="June 08, 2017">
 +    <meta itemprop="dateModified" content="April 26, 2017">
 +
 +    <div class="page__inner-wrap">
 +      
 +        <header>
 +          <h1 class="page__title" itemprop="headline">Filter Example
 +</h1>
 +          
 +        </header>
 +      
 +
 +      <section class="page__content" itemprop="text">
 +        <p>In most cases, tag is a simple and useful design to select message 
you want. For example:</p>
 +
 +<div class="language-java highlighter-rouge"><pre 
class="highlight"><code><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">"CID_EXAMPLE"</span><span class="o">);</span>
 +<span class="n">consumer</span><span class="o">.</span><span 
class="na">subscribe</span><span class="o">(</span><span 
class="s">"TOPIC"</span><span class="o">,</span> <span class="s">"TAGA || TAGB 
|| TAGC"</span><span class="o">);</span>
 +</code></pre>
 +</div>
 +
 +<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="#principle" id="markdown-toc-principle">Principle</a></li>
 +  <li><a href="#grammars" id="markdown-toc-grammars">Grammars</a></li>
 +  <li><a href="#usage-constraints" id="markdown-toc-usage-constraints">Usage 
constraints</a></li>
 +  <li><a href="#producer-example" id="markdown-toc-producer-example">Producer 
example</a></li>
 +  <li><a href="#consumer-example" id="markdown-toc-consumer-example">Consumer 
example</a></li>
 +</ul>
 +
 +  </nav>
 +</aside>
 +
 +<p>The consumer will recieve messages that contains TAGA or TAGB or TAGC. But 
the limitation is that one message only can have one tag, and this may not work 
for sophisticated scenarios. In this case, you can use SQL expression to filter 
out messages.</p>
 +
 +<h3 id="principle">Principle</h3>
 +
 +<p>SQL feature could do some calculation through the properties you put in 
when sending messages. Under the grammars defined by RocketMQ, you can 
implement some interesting logic. Here is an example:</p>
 +
 +<pre>
 +------------
 +| message  |
 +|----------|  a &gt; 5 AND b = 'abc'
 +| a = 10   |  --------------------&gt; Gotten
 +| b = 'abc'|
 +| c = true |
 +------------
 +------------
 +| message  |
 +|----------|   a &gt; 5 AND b = 'abc'
 +| a = 1    |  --------------------&gt; Missed
 +| b = 'abc'|
 +| c = true |
 +------------
 +</pre>
 +
 +<h3 id="grammars">Grammars</h3>
 +
 +<p>RocketMQ only defines some basic grammars to support this feature. You 
could also extend it easily.</p>
 +
 +<ol>
 +  <li>Numeric comparison, like <code class="highlighter-rouge">&gt;</code>, 
<code class="highlighter-rouge">&gt;=</code>, <code 
class="highlighter-rouge">&lt;</code>, <code 
class="highlighter-rouge">&lt;=</code>, <code 
class="highlighter-rouge">BETWEEN</code>, <code 
class="highlighter-rouge">=</code>;</li>
 +  <li>Character comparison, like <code class="highlighter-rouge">=</code>, 
<code class="highlighter-rouge">&lt;&gt;</code>, <code 
class="highlighter-rouge">IN</code>;</li>
 +  <li><code class="highlighter-rouge">IS NULL</code> or <code 
class="highlighter-rouge">IS NOT NULL</code>;</li>
 +  <li>Logical <code class="highlighter-rouge">AND</code>, <code 
class="highlighter-rouge">OR</code>, <code 
class="highlighter-rouge">NOT</code>;</li>
 +</ol>
 +
 +<p>Constant types are:</p>
 +
 +<ol>
 +  <li>Numeric, like 123, 3.1415;</li>
 +  <li>Character, like ‘abc’, must be made with single quotes;</li>
 +  <li><code class="highlighter-rouge">NULL</code>, special constant;</li>
 +  <li>Boolean, <code class="highlighter-rouge">TRUE</code> or <code 
class="highlighter-rouge">FALSE</code>;</li>
 +</ol>
 +
 +<h3 id="usage-constraints">Usage constraints</h3>
 +
 +<p>Only push consumer could select messages by SQL92. The interface is:</p>
 +
 +<p><code class="highlighter-rouge">public void subscribe(final String topic, 
final MessageSelector messageSelector)</code></p>
 +
 +<h3 id="producer-example">Producer example</h3>
 +
 +<p>You can put properties in message through method <code 
class="highlighter-rouge">putUserProperty</code> when sending.</p>
 +
 +<div class="language-java highlighter-rouge"><pre 
class="highlight"><code><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">"please_rename_unique_group_name"</span><span class="o">);</span>
 +<span class="n">producer</span><span class="o">.</span><span 
class="na">start</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="n">tag</span><span class="o">,</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="o">);</span>
 +<span class="c1">// Set some properties.</span>
 +<span class="n">msg</span><span class="o">.</span><span 
class="na">putUserProperty</span><span class="o">(</span><span 
class="s">"a"</span><span class="o">,</span> <span class="n">String</span><span 
class="o">.</span><span class="na">valueOf</span><span class="o">(</span><span 
class="n">i</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="n">producer</span><span class="o">.</span><span 
class="na">shutdown</span><span class="o">();</span>
 +</code></pre>
 +</div>
 +
 +<h3 id="consumer-example">Consumer example</h3>
 +
 +<p>Use <code class="highlighter-rouge">MessageSelector.bySql</code> to select 
messages through SQL92 when consuming.</p>
 +
 +<div class="language-java highlighter-rouge"><pre 
class="highlight"><code><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">"please_rename_unique_group_name_4"</span><span class="o">);</span>
 +
 +<span class="c1">// only subsribe messages have property a, also a &gt;=0 and 
a &lt;= 3</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="o">,</span> <span 
class="n">MessageSelector</span><span class="o">.</span><span 
class="na">bySql</span><span class="o">(</span><span class="s">"a between 0 and 
3"</span><span class="o">);</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="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="n">consumer</span><span class="o">.</span><span 
class="na">start</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="2017-04-26">April 26, 
2017</time></p>
 +        
 +      </footer>
 +
 +      <section class="page__share">
 +  
 +    <h4 class="page__share-title">Share on</h4>
 +  
 +
 +  <a href="https://twitter.com/intent/tweet?via=ApacheRocketMQ&text=Filter 
Example  /docs/filter-by-sql92-example/" class="btn btn--twitter" title="Share 
on Twitter"><i class="fa fa-fw fa-twitter" aria-hidden="true"></i><span> 
Twitter</span></a>
 +
 +  <a 
href="https://www.facebook.com/sharer/sharer.php?u=/docs/filter-by-sql92-example/";
 class="btn btn--facebook" title="Share on Facebook"><i class="fa fa-fw 
fa-facebook" aria-hidden="true"></i><span> Facebook</span></a>
 +
 +  <a href="https://plus.google.com/share?url=/docs/filter-by-sql92-example/"; 
class="btn btn--google-plus" title="Share on Google Plus"><i class="fa fa-fw 
fa-google-plus" aria-hidden="true"></i><span> Google+</span></a>
 +
 +  <a 
href="https://www.linkedin.com/shareArticle?mini=true&url=/docs/filter-by-sql92-example/";
 class="btn btn--linkedin" title="Share on LinkedIn"><i class="fa fa-fw 
fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
 +</section>
 +
 +
 +      
 +  <nav class="pagination">
 +    
 +      <a href="/docs/simple-example/" class="pagination--pager" title="Simple 
Message Example
 +">Previous</a>
 +    
 +    
 +      <a href="/docs/best-practice-broker/" class="pagination--pager" 
title="Best Practice For Broker
 +">Next</a>
 +    
 +  </nav>
 +
 +    </div>
 +
 +    
 +      <div class="page__comments">
 +  
 +  
 +    <h4 class="page__comments-title">Leave a Comment</h4>
 +    <section id="disqus_thread"></section>
 +  
 +</div>
 +    
 +  </article>
 +
 +  
 +  
 +</div>
 +
 +    <div class="page__footer">
 +      <footer>
 +        <!-- start custom footer snippets -->
 +
 +<!-- end custom footer snippets -->
 +        <style type="text/css">
 +  div.columns   { float: left; margin-left: 10px;}
 +  div.clear     { clear: both; } 
 +</style>
 +<div>
 +  <div class="columns">
 +    <a href="https://www.apache.org/";><img 
src="/assets/images/feather-small.gif" alt="Apache Software Foundation" 
style="height: 88px !important" /></a>
 +  </div>
 +  <div class="columns" style="width: 80%">
 +    <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/apache/incubator-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; 2017 <a 
href="http://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</div>
 +  </div>
 +</div>
 +<div class="clear"></div>
 +      </footer>
 +    </div>
 +
 +    <script src="/assets/js/main.min.js"></script>
 +
 +
 +
 +
 +  <script>
 +  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 +  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
 +  
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 +  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 +
 +  ga('create', 'UA-89603173-1', 'auto');
 +  ga('send', 'pageview');
 +</script>
 +
 +<script>
 +var _hmt = _hmt || [];
 +(function() {
 +  var hm = document.createElement("script");
 +  hm.src = "https://hm.baidu.com/hm.js?36428f2b841d08e7405724cbf7f860d2";;
 +  var s = document.getElementsByTagName("script")[0]; 
 +  s.parentNode.insertBefore(hm, s);
 +})();
 +</script>
 +
 +
 +
 +
 +  
 +  <script type="text/javascript">
 +      /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * 
* */
 +      var disqus_shortname = 'rocketmq';
 +
 +      /* * * DON'T EDIT BELOW THIS LINE * * */
 +      (function() {
 +              var dsq = document.createElement('script'); dsq.type = 
'text/javascript'; dsq.async = true;
 +              dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
 +              (document.getElementsByTagName('head')[0] || 
document.getElementsByTagName('body')[0]).appendChild(dsq);
 +      })();
 +
 +      /* * * DON'T EDIT BELOW THIS LINE * * */
 +      (function () {
 +              var s = document.createElement('script'); s.async = true;
 +              s.type = 'text/javascript';
 +              s.src = '//' + disqus_shortname + '.disqus.com/count.js';
 +              (document.getElementsByTagName('HEAD')[0] || 
document.getElementsByTagName('BODY')[0]).appendChild(s);
 +      }());
 +  </script>
 +  <noscript>Please enable JavaScript to view the <a 
href="http://disqus.com/?ref_noscript";>comments powered by 
Disqus.</a></noscript>
 +
 +
 +
 +
 +
 +
 +  </body>
 +</html>

http://git-wip-us.apache.org/repos/asf/incubator-rocketmq-site/blob/af2718af/content/docs/motivation/index.html
----------------------------------------------------------------------
diff --cc content/docs/motivation/index.html
index daec8ae,0000000..afd58ee
mode 100644,000000..100644
--- a/content/docs/motivation/index.html
+++ b/content/docs/motivation/index.html
@@@ -1,693 -1,0 +1,693 @@@
 +<!doctype html>
 +<html lang="en" class="no-js">
 +  <head>
 +    <meta charset="utf-8">
 +
 +<!-- begin SEO -->
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +<title>Motivation - Apache RocketMQ</title>
 +
 +
 +
 +
 +<meta name="description" content="At early stages, we constructed our 
distributed messaging middleware based on ActiveMQ 5.x(prior to 5.3). Our 
multinational business uses it for asynchronous communication, search, social 
network activity stream, data pipeline,even in its trade processes. As our 
trade business throughput rises, pressure originating from our messaging 
clusteralso becomes urgent.">
 +
 +
 +
 +
 +<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="At early stages, we constructed 
our distributed messaging middleware based on ActiveMQ 5.x(prior to 5.3). Our 
multinational business uses it for asynchronous communication, search, social 
network activity stream, data pipeline,even in its trade processes. As our 
trade business throughput rises, pressure originating from our messaging 
clusteralso becomes urgent.">
 +
 +
 +
 +  <meta name="twitter:site" content="@ApacheRocketMQ">
 +  <meta name="twitter:title" content="Motivation">
 +  <meta name="twitter:description" content="At early stages, we constructed 
our distributed messaging middleware based on ActiveMQ 5.x(prior to 5.3). Our 
multinational business uses it for asynchronous communication, search, social 
network activity stream, data pipeline,even in its trade processes. As our 
trade business throughput rises, pressure originating from our messaging 
clusteralso becomes urgent.">
 +  <meta name="twitter:url" content="">
 +
 +  
 +    <meta name="twitter:card" content="summary">
 +    
 +  
 +
 +  
 +
 +
 +
 +  
 +
 +  
 +
 +
 +
 +
 +
 +  <meta property="og:type" content="article">
-   <meta property="article:published_time" content="2017-06-08T17:34:10+08:00">
++  <meta property="article:published_time" content="2017-06-08T18:09:33+08:00">
 +
 +
 +
 +
 +
 +
 +
 +
 +  <script type="application/ld+json">
 +    {
 +      "@context" : "http://schema.org";,
 +      "@type" : "Person",
 +      "name" : "Apache RocketMQ",
 +      "url" : null,
 +      "sameAs" : null
 +    }
 +  </script>
 +
 +
 +
 +  <meta name="google-site-verification" 
content="aand0XZkSGsziuC-UPD4ZJniFD0m0JhGx6820y2mAQY" />
 +
 +
 +  <meta name="baidu-site-verification" content="wD06EbDRkQ" />
 +
 +
 +
 +
 +<!-- 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="/customer/">Customer</a></li>
 +          
 +            
 +            <li class="masthead__menu-item"><a 
href="/about/team/">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/motivation/" class="active">Why 
RocketMQ</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/quick-start/" class="">Quick Start</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/simple-example/" class="">Simple 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/order-example/" class="">Order Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/broadcast-example/" class="">Broadcasting 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/schedule-example/" class="">Schedule 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/batch-example/" class="">Batch Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/filter-by-sql92-example/" class="">Filter 
Example</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/faq/" class="">FAQ</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Deployment & Operations</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/rmq-arc/" class="">Architecture</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/rmq-deployment/" class="">Deployment</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/cli-admin-tool/" class="">CLI Admin 
Tool</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Contributor Guide</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/code-guidelines/" class="">Code 
Guidelines</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/pull-request/" class="">Manage Pull 
Request</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/release-manual" class="">Release 
Manual</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Best Practice</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/core-concept/" class="">Core Concept</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-broker/" class="">Broker</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-producer/" 
class="">Producer</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-consumer/" 
class="">Consumer</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/docs/best-practice-namesvr/" 
class="">NameServer</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          <span class="nav__sub-title">Release Notes</span>
 +        
 +
 +        
 +        <ul>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/dowloading/releases/" class="">Download</a></li>
 +          
 +            
 +            
 +
 +            
 +            
 +
 +            <li><a href="/release_notes/release-notes-4.0.0-incubating/" 
class="">4.0.0-incubating</a></li>
 +          
 +        </ul>
 +        
 +      </li>
 +    
 +      <li>
 +        
 +          
 +          
 +
 +          <a href="/docs/roadmap/"><span 
class="nav__sub-title">RoadMap</span></a>
 +        
 +
 +        
 +      </li>
 +    
 +  </ul>
 +</nav>
 +    
 +  
 +  </div>
 +
 +
 +  <article class="page" itemscope itemtype="http://schema.org/CreativeWork";>
 +    <meta itemprop="headline" content="Motivation">
 +    <meta itemprop="description" content="At early stages, we constructed our 
distributed messaging middleware based on ActiveMQ 5.x(prior to 5.3). Our 
multinational business uses it for asynchronous communication, search, social 
network activity stream, data pipeline,even in its trade processes. As our 
trade business throughput rises, pressure originating from our messaging 
clusteralso becomes urgent.">
 +    <meta itemprop="datePublished" content="June 08, 2017">
 +    <meta itemprop="dateModified" content="December 16, 2016">
 +
 +    <div class="page__inner-wrap">
 +      
 +        <header>
 +          <h1 class="page__title" itemprop="headline">Motivation
 +</h1>
 +          
 +        </header>
 +      
 +
 +      <section class="page__content" itemprop="text">
 +        <p>At early stages, we constructed our distributed messaging 
middleware based on ActiveMQ 5.x(prior to 5.3). Our 
 +multinational business uses it for asynchronous communication, search, social 
network activity stream, data pipeline,
 +even in its trade processes. As our trade business throughput rises, pressure 
originating from our messaging cluster
 +also becomes urgent.</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 research, with increased queues and virtual topics in use, 
ActiveMQ IO module reaches a bottleneck. We 
 +tried our best to solve this problem through throttling, circuit breaker or 
degradation, but it did not work well. So 
 +we begin to focus on the popular messaging solution Kafka at that time. 
Unfortunately, Kafka can not meet our 
 +requirements especially in terms of low latency and high reliability, see <a 
href="/rocketmq/how-to-support-more-queues-in-rocketmq/">here</a> for 
details.</p>
 +
 +<p>In this context, we decided to invent a new messaging engine to handle a 
broader set of use cases, ranging from 
 +traditional pub/sub scenarios to high volume real-time zero-loss tolerance 
transaction system. We believe this solution
 +can be beneficial, so we would like to open source it to the community. 
Today, more than 100 companies are using the 
 +open source version of RocketMQ in their business. We also published a 
commercial distribution based on RocketMQ, a PaaS
 + product called the <a href="https://intl.aliyun.com/";>Alibaba Cloud 
Platform</a>.</p>
 +
 +<p>The following table demonstrates the comparison between RocketMQ, ActiveMQ 
and Kafka (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-16">December 
16, 2016</time></p>
 +        
 +      </footer>
 +
 +      <section class="page__share">
 +  
 +    <h4 class="page__share-title">Share on</h4>
 +  
 +
 +  <a 
href="https://twitter.com/intent/tweet?via=ApacheRocketMQ&text=Motivation 
/docs/motivation/" class="btn btn--twitter" title="Share on Twitter"><i 
class="fa fa-fw fa-twitter" aria-hidden="true"></i><span> Twitter</span></a>
 +
 +  <a href="https://www.facebook.com/sharer/sharer.php?u=/docs/motivation/"; 
class="btn btn--facebook" title="Share on Facebook"><i class="fa fa-fw 
fa-facebook" aria-hidden="true"></i><span> Facebook</span></a>
 +
 +  <a href="https://plus.google.com/share?url=/docs/motivation/"; class="btn 
btn--google-plus" title="Share on Google Plus"><i class="fa fa-fw 
fa-google-plus" aria-hidden="true"></i><span> Google+</span></a>
 +
 +  <a 
href="https://www.linkedin.com/shareArticle?mini=true&url=/docs/motivation/"; 
class="btn btn--linkedin" title="Share on LinkedIn"><i class="fa fa-fw 
fa-linkedin" aria-hidden="true"></i><span> LinkedIn</span></a>
 +</section>
 +
 +
 +      
 +  <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>
 +
 +    
 +      <div class="page__comments">
 +  
 +  
 +    <h4 class="page__comments-title">Leave a Comment</h4>
 +    <section id="disqus_thread"></section>
 +  
 +</div>
 +    
 +  </article>
 +
 +  
 +  
 +</div>
 +
 +    <div class="page__footer">
 +      <footer>
 +        <!-- start custom footer snippets -->
 +
 +<!-- end custom footer snippets -->
 +        <style type="text/css">
 +  div.columns   { float: left; margin-left: 10px;}
 +  div.clear     { clear: both; } 
 +</style>
 +<div>
 +  <div class="columns">
 +    <a href="https://www.apache.org/";><img 
src="/assets/images/feather-small.gif" alt="Apache Software Foundation" 
style="height: 88px !important" /></a>
 +  </div>
 +  <div class="columns" style="width: 80%">
 +    <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/apache/incubator-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; 2017 <a 
href="http://www.apache.org/";>The Apache Software Foundation</a>. All Rights 
Reserved.</div>
 +  </div>
 +</div>
 +<div class="clear"></div>
 +      </footer>
 +    </div>
 +
 +    <script src="/assets/js/main.min.js"></script>
 +
 +
 +
 +
 +  <script>
 +  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
 +  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),
 +  
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
 +  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
 +
 +  ga('create', 'UA-89603173-1', 'auto');
 +  ga('send', 'pageview');
 +</script>
 +
 +<script>
 +var _hmt = _hmt || [];
 +(function() {
 +  var hm = document.createElement("script");
 +  hm.src = "https://hm.baidu.com/hm.js?36428f2b841d08e7405724cbf7f860d2";;
 +  var s = document.getElementsByTagName("script")[0]; 
 +  s.parentNode.insertBefore(hm, s);
 +})();
 +</script>
 +
 +
 +
 +
 +  
 +  <script type="text/javascript">
 +      /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * 
* */
 +      var disqus_shortname = 'rocketmq';
 +
 +      /* * * DON'T EDIT BELOW THIS LINE * * */
 +      (function() {
 +              var dsq = document.createElement('script'); dsq.type = 
'text/javascript'; dsq.async = true;
 +              dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
 +              (document.getElementsByTagName('head')[0] || 
document.getElementsByTagName('body')[0]).appendChild(dsq);
 +      })();
 +
 +      /* * * DON'T EDIT BELOW THIS LINE * * */
 +      (function () {
 +              var s = document.createElement('script'); s.async = true;
 +              s.type = 'text/javascript';
 +              s.src = '//' + disqus_shortname + '.disqus.com/count.js';
 +              (document.getElementsByTagName('HEAD')[0] || 
document.getElementsByTagName('BODY')[0]).appendChild(s);
 +      }());
 +  </script>
 +  <noscript>Please enable JavaScript to view the <a 
href="http://disqus.com/?ref_noscript";>comments powered by 
Disqus.</a></noscript>
 +
 +
 +
 +
 +
 +
 +  </body>
 +</html>

Reply via email to