{"rsdb":{"rid":"170012","subhead":"","postdate":"0","aid":"124532","fid":"88","uid":"1","topic":"1","content":"
\n
\n       Rabbitmq\u7684\u6838\u5fc3\u6982\u5ff5\uff08\u5982\u4e0b\u56fe\u6240\u793a\uff09\uff1a\u6709\u865a\u62df\u4e3b\u673a\u3001\u4ea4\u6362\u673a\u3001\u961f\u5217\u3001\u7ed1\u5b9a\uff1b\n <\/div> \n
\n       \n \"\"\n <\/div> \n
\n
\n      \n <\/div> \n
\n       \u4ea4\u6362\u673a\u53ef\u4ee5\u7406\u89e3\u6210\u5177\u6709\u8def\u7531\u8868\u7684\u8def\u7531\u7a0b\u5e8f\uff0c\u4ec5\u6b64\u800c\u5df2\u3002\u6bcf\u4e2a\u6d88\u606f\u90fd\u6709\u4e00\u4e2a\u79f0\u4e3a\u8def\u7531\u952e\uff08routing key\uff09\u7684\u5c5e\u6027\uff0c\u5c31\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u5b57\u7b26\u4e32\u3002\n <\/div> \n
\n       \u6700\u65b0\u7248\u672c\u7684RabbitMQ\u6709\u56db\u79cd\u4ea4\u6362\u673a\u7c7b\u578b\uff0c\u5206\u522b\u662fDirect exchange\u3001Fanout exchange\u3001Topic exchange\u3001Headers exchange\u3002\n <\/div> \n <\/div> \n
\n       \n Direct Exchange<\/strong> \u2013 \u5904\u7406\u8def\u7531\u952e\u3002\u9700\u8981\u5c06\u4e00\u4e2a\u961f\u5217\u7ed1\u5b9a\u5230\u4ea4\u6362\u673a\u4e0a\uff0c\u8981\u6c42\u8be5\u6d88\u606f\u4e0e\u4e00\u4e2a\u7279\u5b9a\u7684\u8def\u7531\u952e\u5b8c\u5168\u5339\u914d\u3002\u8fd9\u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5339\u914d\u3002\u5982\u679c\u4e00\u4e2a\u961f\u5217\u7ed1\u5b9a\u5230\u8be5\u4ea4\u6362\u673a\u4e0a\u8981\u6c42\u8def\u7531\u952e \u201cdog\u201d\uff0c\u5219\u53ea\u6709\u88ab\u6807\u8bb0\u4e3a\u201cdog\u201d\u7684\u6d88\u606f\u624d\u88ab\u8f6c\u53d1\uff0c\u4e0d\u4f1a\u8f6c\u53d1dog.puppy\uff0c\u4e5f\u4e0d\u4f1a\u8f6c\u53d1dog.guard\uff0c\u53ea\u4f1a\u8f6c\u53d1dog\u3002\n <\/div> \n
\n       \n \"\"\n <\/div> \n
\n     \n  Fanout Exchange<\/strong> \u2013 \u4e0d\u5904\u7406\u8def\u7531\u952e\u3002\u4f60\u53ea\u9700\u8981\u7b80\u5355\u7684\u5c06\u961f\u5217\u7ed1\u5b9a\u5230\u4ea4\u6362\u673a\u4e0a\u3002\u4e00\u4e2a\u53d1\u9001\u5230\u4ea4\u6362\u673a\u7684\u6d88\u606f\u90fd\u4f1a\u88ab\u8f6c\u53d1\u5230\u4e0e\u8be5\u4ea4\u6362\u673a\u7ed1\u5b9a\u7684\u6240\u6709\u961f\u5217\u4e0a\u3002\u5f88\u50cf\u5b50\u7f51\u5e7f\u64ad\uff0c\u6bcf\u53f0\u5b50\u7f51\u5185\u7684\u4e3b\u673a\u90fd\u83b7\u5f97\u4e86\u4e00\u4efd\u590d\u5236\u7684\u6d88\u606f\u3002Fanout\u4ea4\u6362\u673a\u8f6c\u53d1\u6d88\u606f\u662f\u6700\u5feb\u7684\u3002\n <\/div> \n
\n       \n \"\"\n <\/div> \n
\n  \n <\/div> \n
\n       \n Topic Exchange <\/strong>\u2013 \u5c06\u8def\u7531\u952e\u548c\u67d0\u6a21\u5f0f\u8fdb\u884c\u5339\u914d\u3002\u6b64\u65f6\u961f\u5217\u9700\u8981\u7ed1\u5b9a\u8981\u4e00\u4e2a\u6a21\u5f0f\u4e0a\u3002\u7b26\u53f7\u201c#\u201d\u5339\u914d\u4e00\u4e2a\u6216\u591a\u4e2a\u8bcd\uff0c\u7b26\u53f7\u201c*\u201d\u5339\u914d\u4e0d\u591a\u4e0d\u5c11\u4e00\u4e2a\u8bcd\u3002\u56e0\u6b64\u201caudit.#\u201d\u80fd\u591f\u5339\u914d\u5230\u201caudit.irs.corporate\u201d\uff0c\u4f46\u662f\u201caudit.*\u201d \u53ea\u4f1a\u5339\u914d\u5230\u201caudit.irs\u201d\u3002\n <\/div> \n
\n       \n \"\"\n <\/div> \n
\n        \n

      Headers exchange <\/strong>\u2013 \u8fd8\u6ca1\u6709\u4ed4\u7ec6\u7814\u7a76\u8fc7\uff0c\u590d\u5236\u70b9\u5b98\u65b9\u7684\u4ecb\u7ecd\u5427\u3002<\/p> \n

      A headers exchange is designed to for routing on multiple attributes that are more easily expressed as message headers than a routing key. Headers exchanges ignore the routing key attribute. Instead, the attributes used for routing are taken from the headers attribute. A message is considered matching if the value of the header equals the value specified upon binding.<\/p> \n

      It is possible to bind a queue to a headers exchange using more than one header for matching. In this case, the broker needs one more piece of information from the application developer, namely, should it consider messages with any of the headers matching, or all of them? This is what the "x-match" binding argument is for. When the "x-match" argument is set to "any", just one matching header value is sufficient. Alternatively, setting "x-match" to "all" mandates that all the values must match.<\/p> \n

      Headers exchanges can be looked upon as "direct exchanges on steroids". Because they route based on header values, they can be used as direct exchanges where the routing key does not have to be a string; it could be an integer or a hash (dictionary) for example.<\/p> \n <\/div> \n

\n       \u6d88\u606f\u59cb\u7ec8\u90fd\u662f\u5148\u53d1\u9001\u5230\u4ea4\u6362\u673a\uff0c\u7531\u4ea4\u6362\u7ea7\u7ecf\u8fc7\u8def\u7531\u4f20\u9001\u7ed9\u961f\u5217\uff0c\u6d88\u8d39\u8005\u518d\u4ece\u961f\u5217\u4e2d\u83b7\u53d6\u6d88\u606f\u7684\uff01\n <\/div> \n
\n  \n <\/div> \n
\n       \u53c2\u8003\u8d44\u6599\uff1ahttp:\/\/melin.iteye.com\/blog\/691265\n <\/div>\n<\/div>","orderid":"0","title":"RabbitMq\u4e2d\u7684\u4ea4\u6362\u673a","smalltitle":"","mid":"0","fname":"Erlang","special_id":"0","bak_id":"0","info":"0","hits":"8126","pages":"1","comments":"0","posttime":"2017-10-09 14:05:15","list":"1507529115","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"https:\/\/www.cppentry.com\/upload_files\/article\/88\/1_pmfx2__.png","ispic":"1","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"RabbitMq<\/A> \u4ea4\u6362\u673a<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"113.108.110.181","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"RabbitMq\u4e2d\u7684\u4ea4\u6362\u673a","lastview":"1713921225","digg_num":"5225","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}