JMS(Jboss Messaging)的一點使用心得(六)Messaging擴展應用-Message Bridge

相對於JbossMQ,Messaging中增加了Bridge的功能,可以把Message橋接到其他的JMS服務器中。具體的配置手順請參見<http://labs.jboss.com/file-access/default/members/jbossmessaging/freezone/docs/userguide-1.4.0.SP1/html/bridge.html>
在Messaging的包中也有相關的example.Messaging中的例子只是本機之間的Bridge,如果涉及到其他機器,則必須把</jboss-4.2.2.GA/server/messaging/deploy/jms-ds.xml>中的RemoteJMSProvider如下設置:
  <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
     name
="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider">
    
<attribute name="ProviderName">RemoteJMSProvider</attribute>
    
<attribute name="ProviderAdapterClass">
      org.jboss.jms.jndi.JNDIProviderAdapter
    
</attribute>
    
<!-- The combined connection factory -->
    
<attribute name="FactoryRef">XAConnectionFactory</attribute>
    
<!-- The queue connection factory -->
    
<attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
    
<!-- The topic factory -->
    
<attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
    
<!-- Uncomment to use HAJNDI to access JMS-->
    
<attribute name="Properties">
       java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
       java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
       java.naming.provider.url=otherhost:1099
    
</attribute>
注意FactoryRefQueueFactoryRefTopicFactoryRef中都沒有“java:”,因爲java:是表示本地服務的意思,如果寫上了,就不能連接遠程的JMS服務器了。
發佈了29 篇原創文章 · 獲贊 1 · 訪問量 9萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章