{"rsdb":{"rid":"156004","subhead":"","postdate":"0","aid":"117110","fid":"54","uid":"1","topic":"1","content":"

\u3000\u3000\u3000\u3000JMS\u5373Java\u6d88\u606f\u670d\u52a1\uff08Java Message Service\uff09\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff0c\u662f\u4e00\u4e2aJava\u5e73\u53f0\u4e2d\u5173\u4e8e\u9762\u5411\u6d88\u606f\u4e2d\u95f4\u4ef6\uff08MOM\uff09\u7684API\uff0c\u7528\u4e8e\u5728\u4e24\u4e2a\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\uff0c\u6216\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u53d1\u9001\u6d88\u606f\uff0c\u8fdb\u884c\u5f02\u6b65\u901a\u4fe1\u3002Java\u6d88\u606f\u670d\u52a1\u662f\u4e00\u4e2a\u4e0e\u5177\u4f53\u5e73\u53f0\u65e0\u5173\u7684API\uff0c\u7edd\u5927\u591a\u6570MOM\u63d0\u4f9b\u5546\u90fd\u5bf9JMS\u63d0\u4f9b\u652f\u6301\u3002\u6211\u4eec\u53ef\u4ee5\u7b80\u5355\u7684\u7406\u89e3\uff1a\u4e24\u4e2a\u5e94\u7528\u7a0b\u5e8f\u4e4b\u95f4\u9700\u8981\u8fdb\u884c\u901a\u4fe1\uff0c\u6211\u4eec\u4f7f\u7528\u4e00\u4e2aJMS\u670d\u52a1\uff0c\u8fdb\u884c\u4e2d\u95f4\u7684\u8f6c\u53d1\uff0c\u901a\u8fc7JMS \u7684\u4f7f\u7528\uff0c\u6211\u4eec\u53ef\u4ee5\u89e3\u9664\u4e24\u4e2a\u7a0b\u5e8f\u4e4b\u95f4\u7684\u8026\u5408\u3002<\/span><\/p>

\u3000\u3000\u3000JMS\u5177\u6709\u4e24\u79cd\u901a\u4fe1\u6a21\u5f0f\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u30001\u3001Point-to-Point Messaging Domain \uff08\u70b9\u5bf9\u70b9\uff09<\/p>

\u3000\u3000\u3000\u3000\u3000\u30002\u3001Publish\/Subscribe Messaging Domain \uff08\u53d1\u5e03\/\u8ba2\u9605\u6a21\u5f0f\uff09<\/p>

\u3000\u3000\u3000\u5728JMS API\u51fa\u73b0\u4e4b\u524d\uff0c\u5927\u90e8\u5206\u4ea7\u54c1\u4f7f\u7528\u201c\u70b9\u5bf9\u70b9\u201d\u548c\u201c\u53d1\u5e03\/\u8ba2\u9605\u201d\u4e2d\u7684\u4efb\u4e00\u65b9\u5f0f\u6765\u8fdb\u884c\u6d88\u606f\u901a\u8baf\u3002JMS\u5b9a\u4e49\u4e86\u8fd9\u4e24\u79cd\u6d88\u606f\u53d1\u9001\u6a21\u578b\u7684\u89c4\u8303\uff0c\u5b83\u4eec\u76f8\u4e92\u72ec\u7acb\u3002\u4efb\u4f55JMS\u7684\u63d0\u4f9b\u8005\u53ef\u4ee5\u5b9e\u73b0\u5176\u4e2d\u7684\u4e00\u79cd\u6216\u4e24\u79cd\u6a21\u578b\uff0c\u8fd9\u662f\u5b83\u4eec\u81ea\u5df1\u7684\u9009\u62e9\u3002JMS\u89c4\u8303\u63d0\u4f9b\u4e86\u901a\u7528\u63a5\u53e3\u4fdd\u8bc1\u6211\u4eec\u57fa\u4e8eJMS API\u7f16\u5199\u7684\u7a0b\u5e8f\u9002\u7528\u4e8e\u4efb\u4f55\u4e00\u79cd\u6a21\u578b\u3002<\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000a\u3001\u6a21\u5f0f\u56fe\uff1a<\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\"\"<\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000b\u3001\u6d89\u53ca\u5230\u7684\u6982\u5ff5\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5728\u70b9\u5bf9\u70b9\u901a\u4fe1\u6a21\u5f0f\u4e2d\uff0c\u5e94\u7528\u7a0b\u5e8f\u7531\u6d88\u606f\u961f\u5217\uff0c\u53d1\u9001\u65b9\uff0c\u63a5\u6536\u65b9\u7ec4\u6210\u3002\u6bcf\u4e2a\u6d88\u606f\u90fd\u88ab\u53d1\u9001\u5230\u4e00\u4e2a\u7279\u5b9a\u7684\u961f\u5217\uff0c\u63a5\u6536\u8005\u4ece\u961f\u5217\u4e2d\u83b7\u53d6\u6d88\u606f\u3002\u961f\u5217\u4fdd\u7559\u7740\u6d88\u606f\uff0c\u76f4\u5230\u4ed6\u4eec\u88ab\u6d88\u8d39\u6216\u8d85\u65f6\u3002<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000c\u3001\u7279\u70b9\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000a\u3001\u6a21\u5f0f\u56fe\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\"\"<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000b\u3001\u6d89\u53ca\u5230\u7684\u6982\u5ff5\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5728\u53d1\u5e03\/\u8ba2\u9605\u6d88\u606f\u6a21\u578b\u4e2d\uff0c\u53d1\u5e03\u8005\u53d1\u5e03\u4e00\u4e2a\u6d88\u606f\uff0c\u8be5\u6d88\u606f\u901a\u8fc7topic\u4f20\u9012\u7ed9\u6240\u6709\u7684\u5ba2\u6237\u7aef\u3002\u8be5\u6a21\u5f0f\u4e0b\uff0c\u53d1\u5e03\u8005\u4e0e\u8ba2\u9605\u8005\u90fd\u662f\u533f\u540d\u7684\uff0c\u5373\u53d1\u5e03\u8005\u4e0e\u8ba2\u9605\u8005\u90fd\u4e0d\u77e5\u9053\u5bf9\u65b9\u662f\u8c01\u3002\u5e76\u4e14\u53ef\u4ee5\u52a8\u6001\u7684\u53d1\u5e03\u4e0e\u8ba2\u9605Topic\u3002Topic\u4e3b\u8981\u7528\u4e8e\u4fdd\u5b58\u548c\u4f20\u9012\u6d88\u606f\uff0c\u4e14\u4f1a\u4e00\u76f4\u4fdd\u5b58\u6d88\u606f\u76f4\u5230\u6d88\u606f\u88ab\u4f20\u9012\u7ed9\u5ba2\u6237\u7aef\u3002<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000c\u3001\u7279\u70b9\uff1a<\/p>

\u3000\u3000\u3000\u3000\u5728JMS\u4e2d\uff0c\u6d88\u606f\u7684\u4ea7\u751f\u548c\u6d88\u606f\u662f\u5f02\u6b65\u7684\u3002\u5bf9\u4e8e\u6d88\u8d39\u6765\u8bf4\uff0cJMS\u7684\u6d88\u606f\u8005\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u5f0f\u6765\u6d88\u8d39\u6d88\u606f\u3002<\/p>

\u3000\u3000\u3000\u3000\uff081\uff09\u3001\u540c\u6b65\uff08Synchronous\uff09<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5728\u540c\u6b65\u6d88\u8d39\u4fe1\u606f\u6a21\u5f0f\u6a21\u5f0f\u4e2d\uff0c\u8ba2\u9605\u8005\/\u63a5\u6536\u65b9\u901a\u8fc7\u8c03\u7528receive\uff08\uff09\u65b9\u6cd5\u6765\u63a5\u6536\u6d88\u606f\u3002\u5728receive\uff08\uff09\u65b9\u6cd5\u4e2d\uff0c\u7ebf\u7a0b\u4f1a\u963b\u585e\u76f4\u5230\u6d88\u606f\u5230\u8fbe\u6216\u8005\u5230\u6307\u5b9a\u65f6\u95f4\u540e\u6d88\u606f\u4ecd\u672a\u5230\u8fbe\u3002<\/p>

\u3000\u3000\u3000\u3000\uff082\uff09\u3001\u5f02\u6b65\uff08Asynchronous\uff09<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u4f7f\u7528\u5f02\u6b65\u65b9\u5f0f\u63a5\u6536\u6d88\u606f\u7684\u8bdd\uff0c\u6d88\u606f\u8ba2\u9605\u8005\u9700\u6ce8\u518c\u4e00\u4e2a\u6d88\u606f\u76d1\u542c\u8005\uff0c\u7c7b\u4f3c\u4e8e\u4e8b\u4ef6\u76d1\u542c\u5668\uff0c\u53ea\u8981\u6d88\u606f\u5230\u8fbe\uff0cJMS\u670d\u52a1\u63d0\u4f9b\u8005\u4f1a\u901a\u8fc7\u8c03\u7528\u76d1\u542c\u5668\u7684onMessage()\u9012\u9001\u6d88\u606f\u3002<\/p>

\u3000\u3000\u3000\u3000\"\"<\/span><\/p>

\u3000\u3000\u3000\u3000\uff081\uff09\u3001Connection Factories<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u521b\u5efaConnection\u5bf9\u8c61\u7684\u5de5\u5382\uff0c\u9488\u5bf9\u4e24\u79cd\u4e0d\u540c\u7684jms\u6d88\u606f\u6a21\u578b\uff0c\u5206\u522b\u6709QueueConnectionFactory\u548cTopicConnectionFactory\u4e24\u79cd\u3002\u53ef\u4ee5\u901a\u8fc7JNDI\u6765\u67e5\u627eConnectionFactory\u5bf9\u8c61\u3002\u5ba2\u6237\u7aef\u4f7f\u7528\u4e00\u4e2a\u8fde\u63a5\u5de5\u5382\u5bf9\u8c61\u8fde\u63a5\u5230JMS\u670d\u52a1\u63d0\u4f9b\u8005\uff0c\u5b83\u521b\u5efa\u4e86JMS\u670d\u52a1\u63d0\u4f9b\u8005\u548c\u5ba2\u6237\u7aef\u4e4b\u95f4\u7684\u8fde\u63a5\u3002JMS\u5ba2\u6237\u7aef\uff08\u5982\u53d1\u9001\u8005\u6216\u63a5\u53d7\u8005\uff09\u4f1a\u5728JNDI\u540d\u5b57\u7a7a\u95f4\u4e2d\u641c\u7d22\u5e76\u83b7\u53d6\u8be5\u8fde\u63a5\u3002\u4f7f\u7528\u8be5\u8fde\u63a5\uff0c\u5ba2\u6237\u7aef\u80fd\u591f\u4e0e\u76ee\u7684\u5730\u901a\u8baf\uff0c\u5f80\u961f\u5217\u6216\u8bdd\u9898\u53d1\u9001\/\u63a5\u6536\u6d88\u606f\u3002<\/p>

\u3000\u3000\u3000\u3000\uff082\uff09\u3001Destination<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u76ee\u7684\u5730\u6307\u660e\u6d88\u606f\u88ab\u53d1\u9001\u7684\u76ee\u7684\u5730\u4ee5\u53ca\u5ba2\u6237\u7aef\u63a5\u6536\u6d88\u606f\u7684\u6765\u6e90\u3002JMS\u4f7f\u7528\u4e24\u79cd\u76ee\u7684\u5730\uff0c\u961f\u5217\u548c\u8bdd\u9898\u3002\u5982\u4e0b\u4ee3\u7801\u6307\u5b9a\u4e86\u4e00\u4e2a\u961f\u5217\u548c\u8bdd\u9898\uff1a<\/p>

\u3000\u3000\u3000\u3000\u521b\u5efa\u4e00\u4e2a\u961f\u5217Session\uff1a<\/p>

\u3000\u3000\u3000\u3000\u521b\u5efa\u4e00\u4e2aTopic Session\uff1a<\/p>

\u3000\u3000\u3000\u3000\uff083\uff09\u3001Connection<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000Connection\u8868\u793a\u5728\u5ba2\u6237\u7aef\u548cJMS\u7cfb\u7edf\u4e4b\u95f4\u5efa\u7acb\u7684\u94fe\u63a5\uff08\u5bf9TCP\/IP socket\u7684\u5305\u88c5\uff09\u3002Connection\u53ef\u4ee5\u4ea7\u751f\u4e00\u4e2a\u6216\u591a\u4e2aSession\u3002\u8ddfConnectionFactory\u4e00\u6837\uff0cConnection\u4e5f\u6709\u4e24\u79cd\u7c7b\u578b\uff1aQueueConnection\u548cTopicConnection\u3002<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u8fde\u63a5\u5bf9\u8c61\u5c01\u88c5\u4e86\u4e0eJMS\u63d0\u4f9b\u8005\u4e4b\u95f4\u7684\u865a\u62df\u8fde\u63a5\uff0c\u5982\u679c\u6211\u4eec\u6709\u4e00\u4e2aConnectionFactory\u5bf9\u8c61\uff0c\u53ef\u4ee5\u4f7f\u7528\u5b83\u6765\u521b\u5efa\u4e00\u4e2a\u8fde\u63a5\u3002<\/p>

\u3000\u3000\u3000\u3000\uff084\uff09\u3001Session<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000Session \u662f\u6211\u4eec\u5bf9\u6d88\u606f\u8fdb\u884c\u64cd\u4f5c\u7684\u63a5\u53e3\uff0c\u53ef\u4ee5\u901a\u8fc7session\u521b\u5efa\u751f\u4ea7\u8005\u3001\u6d88\u8d39\u8005\u3001\u6d88\u606f\u7b49\u3002Session \u63d0\u4f9b\u4e86\u4e8b\u52a1\u7684\u529f\u80fd\uff0c\u5982\u679c\u9700\u8981\u4f7f\u7528session\u53d1\u9001\/\u63a5\u6536\u591a\u4e2a\u6d88\u606f\u65f6\uff0c\u53ef\u4ee5\u5c06\u8fd9\u4e9b\u53d1\u9001\/\u63a5\u6536\u52a8\u4f5c\u653e\u5230\u4e00\u4e2a\u4e8b\u52a1\u4e2d\u3002<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u6211\u4eec\u53ef\u4ee5\u5728\u8fde\u63a5\u521b\u5efa\u5b8c\u6210\u4e4b\u540e\u521b\u5efasession\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u8fd9\u91cc\u9762\u63d0\u4f9b\u4e86\u53c2\u6570\u4e24\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u662f\u5426\u652f\u6301\u4e8b\u52a1\uff0c\u7b2c\u4e8c\u4e2a\u662f\u4e8b\u52a1\u7684\u7c7b\u578b<\/p>

\u3000\u3000\u3000\u3000\uff085\uff09\u3001Producter<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u6d88\u606f\u751f\u4ea7\u8005\u7531Session\u521b\u5efa\uff0c\u7528\u4e8e\u5f80\u76ee\u7684\u5730\u53d1\u9001\u6d88\u606f\u3002\u751f\u4ea7\u8005\u5b9e\u73b0MessageProducer\u63a5\u53e3\uff0c\u6211\u4eec\u53ef\u4ee5\u4e3a\u76ee\u7684\u5730\u3001\u961f\u5217\u6216\u8bdd\u9898\u521b\u5efa\u751f\u4ea7\u8005\uff1b<\/p>

\u3000\u3000\u3000\u3000\uff086\uff09\u3001Consumer<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u6d88\u606f\u6d88\u8d39\u8005\u7531Session\u521b\u5efa\uff0c\u7528\u4e8e\u63a5\u6536\u88ab\u53d1\u9001\u5230Destination\u7684\u6d88\u606f\u3002<\/p>

\u3000\u3000\u3000\u3000\uff087\uff09\u3001MessageListener<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u6d88\u606f\u76d1\u542c\u5668\u3002\u5982\u679c\u6ce8\u518c\u4e86\u6d88\u606f\u76d1\u542c\u5668\uff0c\u4e00\u65e6\u6d88\u606f\u5230\u8fbe\uff0c\u5c06\u81ea\u52a8\u8c03\u7528\u76d1\u542c\u5668\u7684onMessage\u65b9\u6cd5\u3002EJB\u4e2d\u7684MDB\uff08Message-Driven Bean\uff09\u5c31\u662f\u4e00\u79cdMessageListener\u3002<\/p>","orderid":"0","title":"Java\u6d88\u606f\u961f\u5217--JMS\u6982\u8ff0","smalltitle":"","mid":"0","fname":"linux\u7f16\u7a0b\u57fa\u7840","special_id":"0","bak_id":"0","info":"0","hits":"110","pages":"1","comments":"0","posttime":"2017-01-02 08:15:20","list":"1483316120","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"http:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"Java<\/A> \u6d88\u606f<\/A> \u961f\u5217<\/A> --JMS<\/A> \u6982\u8ff0<\/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":"14.17.22.31","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"Java\u6d88\u606f\u961f\u5217--JMS\u6982\u8ff0","lastview":"1493295764","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}