blob: 99f1de1639c515e35da9b14e3951825b921f9e40 [file] [log] [blame]
"use strict";(self.webpackChunkrocketmq_docs=self.webpackChunkrocketmq_docs||[]).push([[8490],{15680:(e,n,r)=>{r.d(n,{xA:()=>c,yg:()=>s});var a=r(96540);function t(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function l(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,a)}return r}function o(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?l(Object(r),!0).forEach((function(n){t(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))}))}return e}function p(e,n){if(null==e)return{};var r,a,t=function(e,n){if(null==e)return{};var r,a,t={},l=Object.keys(e);for(a=0;a<l.length;a++)r=l[a],n.indexOf(r)>=0||(t[r]=e[r]);return t}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(t[r]=e[r])}return t}var i=a.createContext({}),u=function(e){var n=a.useContext(i),r=n;return e&&(r="function"==typeof e?e(n):o(o({},n),e)),r},c=function(e){var n=u(e.components);return a.createElement(i.Provider,{value:n},e.children)},m="mdxType",g={inlineCode:"code",wrapper:function(e){var n=e.children;return a.createElement(a.Fragment,{},n)}},y=a.forwardRef((function(e,n){var r=e.components,t=e.mdxType,l=e.originalType,i=e.parentName,c=p(e,["components","mdxType","originalType","parentName"]),m=u(r),y=t,s=m["".concat(i,".").concat(y)]||m[y]||g[y]||l;return r?a.createElement(s,o(o({ref:n},c),{},{components:r})):a.createElement(s,o({ref:n},c))}));function s(e,n){var r=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var l=r.length,o=new Array(l);o[0]=y;var p={};for(var i in n)hasOwnProperty.call(n,i)&&(p[i]=n[i]);p.originalType=e,p[m]="string"==typeof e?e:t,o[1]=p;for(var u=2;u<l;u++)o[u]=r[u];return a.createElement.apply(null,o)}return a.createElement.apply(null,r)}y.displayName="MDXCreateElement"},34601:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>i,contentTitle:()=>o,default:()=>g,frontMatter:()=>l,metadata:()=>p,toc:()=>u});var a=r(58168),t=(r(96540),r(15680));const l={},o="\u6d88\u8d39\u8005\uff08Consumer\uff09",p={unversionedId:"domainModel/08consumer",id:"version-5.0/domainModel/08consumer",title:"\u6d88\u8d39\u8005\uff08Consumer\uff09",description:"\u672c\u6587\u4ecb\u7ecd Apache RocketMQ \u4e2d\u6d88\u8d39\u8005\uff08Consumer\uff09\u7684\u5b9a\u4e49\u3001\u6a21\u578b\u5173\u7cfb\u3001\u5185\u90e8\u5c5e\u6027\u3001\u884c\u4e3a\u7ea6\u675f\u3001\u7248\u672c\u517c\u5bb9\u6027\u53ca\u4f7f\u7528\u5efa\u8bae\u3002",source:"@site/versioned_docs/version-5.0/03-domainModel/08consumer.md",sourceDirName:"03-domainModel",slug:"/domainModel/08consumer",permalink:"/zh/docs/domainModel/08consumer",draft:!1,editUrl:"https://github.com/apache/rocketmq-site/tree/new-official-website/versioned_docs/version-5.0/03-domainModel/08consumer.md",tags:[],version:"5.0",frontMatter:{},sidebar:"version-5.0/myAutogeneratedSidebar",previous:{title:"\u6d88\u8d39\u8005\u5206\u7ec4\uff08ConsumerGroup\uff09",permalink:"/zh/docs/domainModel/07consumergroup"},next:{title:"\u8ba2\u9605\u5173\u7cfb\uff08Subscription\uff09",permalink:"/zh/docs/domainModel/09subscription"}},i={},u=[{value:"\u5b9a\u4e49",id:"\u5b9a\u4e49",level:2},{value:"\u6a21\u578b\u5173\u7cfb",id:"\u6a21\u578b\u5173\u7cfb",level:2},{value:"\u5185\u90e8\u5c5e\u6027",id:"\u5185\u90e8\u5c5e\u6027",level:2},{value:"\u884c\u4e3a\u7ea6\u675f",id:"\u884c\u4e3a\u7ea6\u675f",level:2},{value:"\u7248\u672c\u517c\u5bb9\u6027",id:"\u7248\u672c\u517c\u5bb9\u6027",level:2},{value:"\u4f7f\u7528\u5efa\u8bae",id:"\u4f7f\u7528\u5efa\u8bae",level:2}],c={toc:u},m="wrapper";function g(e){let{components:n,...l}=e;return(0,t.yg)(m,(0,a.A)({},c,l,{components:n,mdxType:"MDXLayout"}),(0,t.yg)("h1",{id:"\u6d88\u8d39\u8005consumer"},"\u6d88\u8d39\u8005\uff08Consumer\uff09"),(0,t.yg)("p",null,"\u672c\u6587\u4ecb\u7ecd Apache RocketMQ \u4e2d\u6d88\u8d39\u8005\uff08Consumer\uff09\u7684\u5b9a\u4e49\u3001\u6a21\u578b\u5173\u7cfb\u3001\u5185\u90e8\u5c5e\u6027\u3001\u884c\u4e3a\u7ea6\u675f\u3001\u7248\u672c\u517c\u5bb9\u6027\u53ca\u4f7f\u7528\u5efa\u8bae\u3002"),(0,t.yg)("h2",{id:"\u5b9a\u4e49"},"\u5b9a\u4e49"),(0,t.yg)("p",null,"\u6d88\u8d39\u8005\u662f Apache RocketMQ \u4e2d\u7528\u6765\u63a5\u6536\u5e76\u5904\u7406\u6d88\u606f\u7684\u8fd0\u884c\u5b9e\u4f53\u3002 \u6d88\u8d39\u8005\u901a\u5e38\u88ab\u96c6\u6210\u5728\u4e1a\u52a1\u7cfb\u7edf\u4e2d\uff0c\u4ece Apache RocketMQ \u670d\u52a1\u7aef\u83b7\u53d6\u6d88\u606f\uff0c\u5e76\u5c06\u6d88\u606f\u8f6c\u5316\u6210\u4e1a\u52a1\u53ef\u7406\u89e3\u7684\u4fe1\u606f\uff0c\u4f9b\u4e1a\u52a1\u903b\u8f91\u5904\u7406\u3002"),(0,t.yg)("p",null,"\u5728\u6d88\u606f\u6d88\u8d39\u7aef\uff0c\u53ef\u4ee5\u5b9a\u4e49\u5982\u4e0b\u4f20\u8f93\u884c\u4e3a\uff1a"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u6d88\u8d39\u8005\u8eab\u4efd\uff1a\u6d88\u8d39\u8005\u5fc5\u987b\u5173\u8054\u4e00\u4e2a\u6307\u5b9a\u7684\u6d88\u8d39\u8005\u5206\u7ec4\uff0c\u4ee5\u83b7\u53d6\u5206\u7ec4\u5185\u7edf\u4e00\u5b9a\u4e49\u7684\u884c\u4e3a\u914d\u7f6e\u548c\u6d88\u8d39\u72b6\u6001\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u6d88\u8d39\u8005\u7c7b\u578b\uff1aApache RocketMQ \u9762\u5411\u4e0d\u540c\u7684\u5f00\u53d1\u573a\u666f\u63d0\u4f9b\u4e86\u591a\u6837\u7684\u6d88\u8d39\u8005\u7c7b\u578b\uff0c\u5305\u62ecPushConsumer\u7c7b\u578b\u3001SimpleConsumer\u7c7b\u578b\u3001PullConsumer\u7c7b\u578b\uff08\u4ec5\u63a8\u8350\u6d41\u5904\u7406\u573a\u666f\u4f7f\u7528\uff09\u7b49\u3002\u5177\u4f53\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1",(0,t.yg)("a",{parentName:"p",href:"/zh/docs/featureBehavior/06consumertype"},"\u6d88\u8d39\u8005\u5206\u7c7b"),"\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u6d88\u8d39\u8005\u672c\u5730\u8fd0\u884c\u914d\u7f6e\uff1a\u6d88\u8d39\u8005\u6839\u636e\u4e0d\u540c\u7684\u6d88\u8d39\u8005\u7c7b\u578b\uff0c\u63a7\u5236\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u672c\u5730\u7684\u8fd0\u884c\u914d\u7f6e\u3002\u4f8b\u5982\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u7684\u7ebf\u7a0b\u6570\uff0c\u6d88\u8d39\u5e76\u53d1\u5ea6\u7b49\uff0c\u5b9e\u73b0\u4e0d\u540c\u7684\u4f20\u8f93\u6548\u679c\u3002"))),(0,t.yg)("h2",{id:"\u6a21\u578b\u5173\u7cfb"},"\u6a21\u578b\u5173\u7cfb"),(0,t.yg)("p",null,"\u5728 Apache RocketMQ \u7684\u9886\u57df\u6a21\u578b\u4e2d\uff0c\u6d88\u8d39\u8005\u7684\u4f4d\u7f6e\u548c\u6d41\u7a0b\u5982\u4e0b\uff1a",(0,t.yg)("img",{alt:"\u6d88\u8d39\u8005",src:r(35369).A,width:"1977",height:"877"})),(0,t.yg)("ol",null,(0,t.yg)("li",{parentName:"ol"},(0,t.yg)("p",{parentName:"li"},"\u6d88\u606f\u7531\u751f\u4ea7\u8005\u521d\u59cb\u5316\u5e76\u53d1\u9001\u5230Apache RocketMQ \u670d\u52a1\u7aef\u3002")),(0,t.yg)("li",{parentName:"ol"},(0,t.yg)("p",{parentName:"li"},"\u6d88\u606f\u6309\u7167\u5230\u8fbeApache RocketMQ \u670d\u52a1\u7aef\u7684\u987a\u5e8f\u5b58\u50a8\u5230\u4e3b\u9898\u7684\u6307\u5b9a\u961f\u5217\u4e2d\u3002")),(0,t.yg)("li",{parentName:"ol"},(0,t.yg)("p",{parentName:"li"},"\u6d88\u8d39\u8005\u6309\u7167\u6307\u5b9a\u7684\u8ba2\u9605\u5173\u7cfb\u4eceApache RocketMQ \u670d\u52a1\u7aef\u4e2d\u83b7\u53d6\u6d88\u606f\u5e76\u6d88\u8d39\u3002"))),(0,t.yg)("h2",{id:"\u5185\u90e8\u5c5e\u6027"},"\u5185\u90e8\u5c5e\u6027"),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u6d88\u8d39\u8005\u5206\u7ec4\u540d\u79f0")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u5b9a\u4e49\uff1a\u5f53\u524d\u6d88\u8d39\u8005\u5173\u8054\u7684\u6d88\u8d39\u8005\u5206\u7ec4\u540d\u79f0\uff0c\u6d88\u8d39\u8005\u5fc5\u987b\u5173\u8054\u5230\u6307\u5b9a\u7684\u6d88\u8d39\u8005\u5206\u7ec4\uff0c\u901a\u8fc7\u6d88\u8d39\u8005\u5206\u7ec4\u83b7\u53d6\u6d88\u8d39\u884c\u4e3a\u3002\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1",(0,t.yg)("a",{parentName:"p",href:"/zh/docs/domainModel/07consumergroup"},"\u6d88\u8d39\u8005\u5206\u7ec4\uff08ConsumerGroup\uff09"),"\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u53d6\u503c\uff1a\u6d88\u8d39\u8005\u5206\u7ec4\u4e3aApache RocketMQ \u7684\u903b\u8f91\u8d44\u6e90\uff0c\u9700\u8981\u60a8\u63d0\u524d\u901a\u8fc7\u63a7\u5236\u53f0\u6216OpenAPI\u521b\u5efa\u3002\u5177\u4f53\u547d\u540d\u683c\u5f0f\uff0c\u8bf7\u53c2\u89c1",(0,t.yg)("a",{parentName:"p",href:"/zh/docs/introduction/03limits"},"\u4f7f\u7528\u9650\u5236"),"\u3002"))),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u5ba2\u6237\u7aefID")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u5b9a\u4e49\uff1a\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u7684\u6807\u8bc6\uff0c\u7528\u4e8e\u533a\u5206\u4e0d\u540c\u7684\u6d88\u8d39\u8005\u3002\u96c6\u7fa4\u5185\u5168\u5c40\u552f\u4e00\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u53d6\u503c\uff1a\u5ba2\u6237\u7aefID\u7531Apache RocketMQ \u7684SDK\u81ea\u52a8\u751f\u6210\uff0c\u4e3b\u8981\u7528\u4e8e\u65e5\u5fd7\u67e5\u770b\u3001\u95ee\u9898\u5b9a\u4f4d\u7b49\u8fd0\u7ef4\u573a\u666f\uff0c\u4e0d\u652f\u6301\u4fee\u6539\u3002"))),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u901a\u4fe1\u53c2\u6570")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"\u63a5\u5165\u70b9\u4fe1\u606f ",(0,t.yg)("strong",{parentName:"li"},"\uff08\u5fc5\u9009\uff09")," \uff1a\u8fde\u63a5\u670d\u52a1\u7aef\u7684\u63a5\u5165\u5730\u5740\uff0c\u7528\u4e8e\u8bc6\u522b\u670d\u52a1\u7aef\u96c6\u7fa4\u3002 \u63a5\u5165\u70b9\u5fc5\u987b\u6309\u683c\u5f0f\u914d\u7f6e\uff0c\u5efa\u8bae\u4f7f\u7528\u57df\u540d\uff0c\u907f\u514d\u4f7f\u7528IP\u5730\u5740\uff0c\u9632\u6b62\u8282\u70b9\u53d8\u66f4\u65e0\u6cd5\u8fdb\u884c\u70ed\u70b9\u8fc1\u79fb\u3002"),(0,t.yg)("li",{parentName:"ul"},"\u8eab\u4efd\u8ba4\u8bc1\u4fe1\u606f ",(0,t.yg)("strong",{parentName:"li"},"\uff08\u53ef\u9009\uff09")," \uff1a\u5ba2\u6237\u7aef\u7528\u4e8e\u8eab\u4efd\u9a8c\u8bc1\u7684\u51ed\u8bc1\u4fe1\u606f\u3002 \u4ec5\u5728\u670d\u52a1\u7aef\u5f00\u542f\u8eab\u4efd\u8bc6\u522b\u548c\u8ba4\u8bc1\u65f6\u9700\u8981\u4f20\u8f93\u3002"),(0,t.yg)("li",{parentName:"ul"},"\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4 ",(0,t.yg)("strong",{parentName:"li"},"\uff08\u53ef\u9009\uff09")," \uff1a\u5ba2\u6237\u7aef\u7f51\u7edc\u8bf7\u6c42\u8c03\u7528\u7684\u8d85\u65f6\u65f6\u95f4\u3002\u53d6\u503c\u8303\u56f4\u548c\u9ed8\u8ba4\u503c\uff0c\u8bf7\u53c2\u89c1",(0,t.yg)("a",{parentName:"li",href:"/zh/docs/introduction/03limits"},"\u53c2\u6570\u9650\u5236"),"\u3002")),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u9884\u7ed1\u5b9a\u8ba2\u9605\u5173\u7cfb\u5217\u8868")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"\u5b9a\u4e49\uff1a\u6307\u5b9a\u6d88\u8d39\u8005\u7684\u8ba2\u9605\u5173\u7cfb\u5217\u8868\u3002 Apache RocketMQ \u670d\u52a1\u7aef\u53ef\u5728\u6d88\u8d39\u8005\u521d\u59cb\u5316\u9636\u6bb5\uff0c\u6839\u636e\u9884\u7ed1\u5b9a\u7684\u8ba2\u9605\u5173\u7cfb\u5217\u8868\u5bf9\u76ee\u6807\u4e3b\u9898\u8fdb\u884c\u6743\u9650\u53ca\u5408\u6cd5\u6027\u6821\u9a8c\uff0c\u65e0\u9700\u7b49\u5230\u5e94\u7528\u542f\u52a8\u540e\u624d\u80fd\u6821\u9a8c\u3002")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"\u53d6\u503c\uff1a\u5efa\u8bae\u5728\u6d88\u8d39\u8005\u521d\u59cb\u5316\u9636\u6bb5\u660e\u786e\u8ba2\u9605\u5173\u7cfb\u5373\u8981\u8ba2\u9605\u7684\u4e3b\u9898\u5217\u8868\uff0c\u82e5\u672a\u8bbe\u7f6e\uff0c\u6216\u8ba2\u9605\u7684\u4e3b\u9898\u52a8\u6001\u53d8\u66f4\uff0cApache RocketMQ \u4f1a\u5bf9\u76ee\u6807\u4e3b\u9898\u8fdb\u884c\u52a8\u6001\u8865\u5145\u6821\u9a8c\u3002")),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u6d88\u8d39\u76d1\u542c\u5668")),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u5b9a\u4e49\uff1aApache RocketMQ \u670d\u52a1\u7aef\u5c06\u6d88\u606f\u63a8\u9001\u7ed9\u6d88\u8d39\u8005\u540e\uff0c\u6d88\u8d39\u8005\u8c03\u7528\u6d88\u606f\u6d88\u8d39\u903b\u8f91\u7684\u76d1\u542c\u5668\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u53d6\u503c\uff1a\u7531\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u672c\u5730\u914d\u7f6e\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u7ea6\u675f\uff1a\u4f7f\u7528PushConsumer\u7c7b\u578b\u7684\u6d88\u8d39\u8005\u6d88\u8d39\u6d88\u606f\u65f6\uff0c\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u5fc5\u987b\u8bbe\u7f6e\u6d88\u8d39\u76d1\u542c\u5668\u3002\u6d88\u8d39\u8005\u7c7b\u578b\u7684\u5177\u4f53\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1",(0,t.yg)("a",{parentName:"p",href:"/zh/docs/featureBehavior/06consumertype"},"\u6d88\u8d39\u8005\u5206\u7c7b"),"\u3002"))),(0,t.yg)("h2",{id:"\u884c\u4e3a\u7ea6\u675f"},"\u884c\u4e3a\u7ea6\u675f"),(0,t.yg)("p",null,"\u5728 Apache RocketMQ \u9886\u57df\u6a21\u578b\u4e2d\uff0c\u6d88\u8d39\u8005\u7684\u7ba1\u7406\u901a\u8fc7\u6d88\u8d39\u8005\u5206\u7ec4\u5b9e\u73b0\uff0c\u540c\u4e00\u5206\u7ec4\u5185\u7684\u6d88\u8d39\u8005\u5171\u540c\u5206\u644a\u6d88\u606f\u8fdb\u884c\u6d88\u8d39\u3002\u56e0\u6b64\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u5206\u7ec4\u5185\u6d88\u606f\u7684\u6b63\u5e38\u8d1f\u8f7d\u548c\u6d88\u8d39\uff0c"),(0,t.yg)("p",null,"Apache RocketMQ \u8981\u6c42\u540c\u4e00\u5206\u7ec4\u4e0b\u7684\u6240\u6709\u6d88\u8d39\u8005\u4ee5\u4e0b\u6d88\u8d39\u884c\u4e3a\u4fdd\u6301\u4e00\u81f4\uff1a"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"\u6295\u9012\u987a\u5e8f")," ")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},(0,t.yg)("strong",{parentName:"p"},"\u6d88\u8d39\u91cd\u8bd5\u7b56\u7565")," "))),(0,t.yg)("h2",{id:"\u7248\u672c\u517c\u5bb9\u6027"},"\u7248\u672c\u517c\u5bb9\u6027"),(0,t.yg)("p",null,"\u5982\u884c\u4e3a\u7ea6\u675f\u4e2d\u6240\u8ff0\uff0c\u540c\u4e00\u5206\u7ec4\u5185\u6240\u6709\u6d88\u8d39\u8005\u7684\u6295\u9012\u987a\u5e8f\u548c\u6d88\u8d39\u91cd\u8bd5\u7b56\u7565\u9700\u8981\u4fdd\u6301\u4e00\u81f4\u3002"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"Apache RocketMQ \u670d\u52a1\u7aef5.x\u7248\u672c\uff1a\u4e0a\u8ff0\u6d88\u8d39\u8005\u7684\u6d88\u8d39\u884c\u4e3a\u4ece\u5173\u8054\u7684\u6d88\u8d39\u8005\u5206\u7ec4\u4e2d\u7edf\u4e00\u83b7\u53d6\uff0c\u56e0\u6b64\uff0c\u540c\u4e00\u5206\u7ec4\u5185\u6240\u6709\u6d88\u8d39\u8005\u7684\u6d88\u8d39\u884c\u4e3a\u5fc5\u7136\u662f\u4e00\u81f4\u7684\uff0c\u5ba2\u6237\u7aef\u65e0\u9700\u5173\u6ce8\u3002")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"Apache RocketMQ \u670d\u52a1\u7aef3.x/4.x\u5386\u53f2\u7248\u672c\uff1a\u4e0a\u8ff0\u6d88\u8d39\u903b\u8f91\u7531\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u63a5\u53e3\u5b9a\u4e49\uff0c\u56e0\u6b64\uff0c\u60a8\u9700\u8981\u81ea\u5df1\u5728\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u8bbe\u7f6e\u65f6\u4fdd\u8bc1\u540c\u4e00\u5206\u7ec4\u4e0b\u7684\u6d88\u8d39\u8005\u7684\u6d88\u8d39\u884c\u4e3a\u4e00\u81f4\u3002"))),(0,t.yg)("p",null,"\u82e5\u60a8\u4f7f\u7528 Apache RocketMQ \u670d\u52a1\u7aef5.x\u7248\u672c\uff0c\u5ba2\u6237\u7aef\u4f7f\u7528\u5386\u53f2\u7248\u672cSDK\uff0c\u5219\u6d88\u8d39\u8005\u7684\u6d88\u8d39\u903b\u8f91\u4ee5\u6d88\u8d39\u8005\u5ba2\u6237\u7aef\u63a5\u53e3\u7684\u8bbe\u7f6e\u4e3a\u51c6\u3002"),(0,t.yg)("h2",{id:"\u4f7f\u7528\u5efa\u8bae"},"\u4f7f\u7528\u5efa\u8bae"),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u4e0d\u5efa\u8bae\u5728\u5355\u4e00\u8fdb\u7a0b\u5185\u521b\u5efa\u5927\u91cf\u6d88\u8d39\u8005")),(0,t.yg)("p",null,"Apache RocketMQ \u7684\u6d88\u8d39\u8005\u5728\u901a\u4fe1\u534f\u8bae\u5c42\u9762\u652f\u6301\u975e\u963b\u585e\u4f20\u8f93\u6a21\u5f0f\uff0c\u7f51\u7edc\u901a\u4fe1\u6548\u7387\u8f83\u9ad8\uff0c\u5e76\u4e14\u652f\u6301\u591a\u7ebf\u7a0b\u5e76\u53d1\u8bbf\u95ee\u3002\u56e0\u6b64\uff0c\u5927\u90e8\u5206\u573a\u666f\u4e0b\uff0c\u5355\u4e00\u8fdb\u7a0b\u5185\u540c\u4e00\u4e2a\u6d88\u8d39\u5206\u7ec4\u53ea\u9700\u8981\u521d\u59cb\u5316\u552f\u4e00\u7684\u4e00\u4e2a\u6d88\u8d39\u8005\u5373\u53ef\uff0c\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5e94\u907f\u514d\u4ee5\u76f8\u540c\u7684\u914d\u7f6e\u521d\u59cb\u5316\u591a\u4e2a\u6d88\u8d39\u8005\u3002"),(0,t.yg)("p",null,(0,t.yg)("strong",{parentName:"p"},"\u4e0d\u5efa\u8bae\u9891\u7e41\u521b\u5efa\u548c\u9500\u6bc1\u6d88\u8d39\u8005")),(0,t.yg)("p",null,"Apache RocketMQ \u7684\u6d88\u8d39\u8005\u662f\u53ef\u4ee5\u91cd\u590d\u5229\u7528\u7684\u5e95\u5c42\u8d44\u6e90\uff0c\u7c7b\u4f3c\u6570\u636e\u5e93\u7684\u8fde\u63a5\u6c60\u3002\u56e0\u6b64\u4e0d\u9700\u8981\u5728\u6bcf\u6b21\u63a5\u6536\u6d88\u606f\u65f6\u52a8\u6001\u521b\u5efa\u6d88\u8d39\u8005\uff0c\u4e14\u5728\u6d88\u8d39\u5b8c\u6210\u540e\u9500\u6bc1\u6d88\u8d39\u8005\u3002\u8fd9\u6837\u9891\u7e41\u5730\u521b\u5efa\u9500\u6bc1\u4f1a\u5728\u670d\u52a1\u7aef\u4ea7\u751f\u5927\u91cf\u77ed\u8fde\u63a5\u8bf7\u6c42\uff0c\u4e25\u91cd\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u3002"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u6b63\u786e\u793a\u4f8b"),(0,t.yg)("pre",{parentName:"li"},(0,t.yg)("code",{parentName:"pre",className:"language-java"},"Consumer c = ConsumerBuilder.build();\nfor (int i =0;i<n;i++){\n Message m= c.receive();\n //process message\n }\nc.shutdown();\n"))),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"\u5178\u578b\u9519\u8bef\u793a\u4f8b"),(0,t.yg)("pre",{parentName:"li"},(0,t.yg)("code",{parentName:"pre",className:"language-java"},"for (int i =0;i<n;i++){\n Consumer c = ConsumerBuilder.build();\n Message m= c.receive();\n //process message\n c.shutdown();\n }\n")))))}g.isMDXComponent=!0},35369:(e,n,r)=>{r.d(n,{A:()=>a});const a=r.p+"assets/images/archiforconsumer-24914573add839fdf2ba2cbc0fcab7c4.png"}}]);