輕松

          記述我學(xué)習(xí)java的里程

          常用鏈接

          統(tǒng)計

          積分與排名

          友情鏈接

          最新評論

          weblogic和mq的集成

          weblogic:8.1 sp2
          MQ:5.3

          摘要:把weblogic 和MQ集成起來是非常有價值的應(yīng)用。本文討論使用weblogic的Foreign JMS Server 配置JNDI,MDB配置,使用MQ提供的
          JMSADMIN配置MQ的jndi。也沒有那么詳細啦,還是需要讀者自己作一番小小的努力的。

          關(guān)鍵詞:jms,Weblogic foreign JMS Server,JNDI,JMSAdmin

          開始:
          1、安裝Weblogic 和MQ(廢話)。
          2、配置JMSAdmin(就是在 mq安裝目錄下的 java/bin/目錄里沒有擴展名的的文件)
          uncomment下面兩行,同時在你的機器上建相應(yīng)的目錄C:/JNDI-Directory


          java代碼: 



          INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory

          PROVIDER_URL=file:/C:/JNDI-Directory   




          以上配置適用于使用文件jndi。
          3、配置mq的jndi
          下面使用jmsadmin配置mq的jndi。
          下面是使用jmsadmin的一些命令的例子。
          其實你可以去ibm的網(wǎng)站上面下載圖形界面的東東,就不用記這些命令啦。
          這個東東叫:JMSADMINGUI


          java代碼: 



          def qcf(ivtQCF)
          def q(ivtQ) qu(SYSTEM.DEFAULT.LOCAL.QUEUE)
          def tcf(ivtTCF)
          def t(ivtT) topic(MQJMS/PSIVT/Information)





          或者你可以執(zhí)行IVTSETUP腳本來完成一個可以使用的JNDI配置。

          4、配置Weblogic的Foreign JMSServer以下屬性進行配置:
          java代碼: 


          JNDI Initial Context Factory->com.sun.jndi.fscontext.RefFSContextFactory
          JNDI Connection URL->file:/C:/JNDI-Directory     



          5、配置Foreign JMS Connection Factories

          代碼:
          java代碼: 


          Local JNDI Name:mqqcf(在weblogic 中使用的QueueConnectionFactory的JNDI的名字)
          Remote JNDI Name:ivtQCF(已經(jīng)在通過jmsadmin配置o玫?jndi的名字)



          6、配置foreign JMS destination

          java代碼: 



          Local JNDI Name: MQQUEUE
          Remote JNDI Name: ivtQ
                 



          同上。
          7、MDB配置



          java代碼: 



          <?xml version="1.0"?>
          <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
          <!-- This ejb-jar.xml file defines a message-driven bean called "SimpleMDB". It uses container-managed transactions, because "transaction-type" is "Container" and "trans-attribute" is "Required". -->
          <ejb-jar>
             <enterprise-beans>
                <message-driven>
                   <ejb-name>ReceiveMessageMDB</ejb-name>
                   <ejb-class>com.rm.mdb.ReceiveMessageBean</ejb-class>
                   <transaction-type>Container</transaction-type>
                   <message-driven-destination>
                   <!-- In WebLogic Server 6.0, this next parameter is named "jms-destination-type" -->
                   <destination-type>javax.jms.Queue</destination-type>
                   </message-driven-destination>
                </message-driven>
             </enterprise-beans>
             <assembly-descriptor>
                <container-transaction>
                   <method>
                      <ejb-name>ReceiveMessageMDB</ejb-name>
                      <method-name>*</method-name>
                   </method>
                   <trans-attribute>NotSupported</trans-attribute>
                </container-transaction>
             </assembly-descriptor>
          </ejb-jar>       



          java代碼: 


          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN' 'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>
          <weblogic-ejb-jar>
          <weblogic-enterprise-bean>
          <ejb-name>ReceiveMessageMDB</ejb-name>
          <message-driven-descriptor>
          <pool>
          <max-beans-in-free-pool>8</max-beans-in-free-pool>
          <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
          </pool>
          <destination-jndi-name>MQQUEUE</destination-jndi-name>
          <initial-context-factory> weblogic.jndi.WLInitialContextFactory </initial-context-factory>
          <provider-url>t3://localhost:7001</provider-url>
          <connection-factory-jndi-name>MQQCF</connection-factory-jndi-name>
          </message-driven-descriptor>
          </weblogic-enterprise-bean>
          </weblogic-ejb-jar>
                 



          注意:
          如果 ejb-jar.xml中的<trans-attribute>NotSupported</trans-attribute>
          為required則需要使用XAQueueConnectionFactory.

          posted on 2006-03-07 11:51 輕松 閱讀(3397) 評論(1)  編輯  收藏 所屬分類: JAVA轉(zhuǎn)貼

          評論

          # seo対策 2007-09-21 09:57 seo対策

          多數(shù)のサイトと簡単にリンク交換が可能、アクセスアップとSEO対策を支援する自動相互リンクサービス相互リンクを増やそうと思う方へ 単なるリンクの數(shù)のみではなく、リンクの質(zhì)も念頭に置いてください。  回復(fù)  更多評論   

          主站蜘蛛池模板: 塘沽区| 深水埗区| 水城县| 紫云| 宣武区| 汉川市| 南投县| 新邵县| 石林| 靖江市| 石楼县| 娄底市| 郴州市| 邹平县| 沁阳市| 资溪县| 滨海县| 乌什县| 柞水县| 洪湖市| 青田县| 阿巴嘎旗| 婺源县| 厦门市| 葵青区| 全州县| 青田县| 合阳县| 新野县| 莫力| 嘉祥县| 大丰市| 北海市| 察雅县| 乾安县| 江山市| 乐安县| 大余县| 成武县| 金坛市| 界首市|