[jboss-dev-forums] [JBoss Messaging Development] - Sending messages from jboss to other application server(webs

mnenchev do-not-reply at jboss.com
Fri Oct 30 07:56:33 EDT 2009


Hi, I have a system deployed on jboss AS. It uses jms messaging for many things. Now i need to send JMS messages to other system, that uses websphere AS. Is it possible jboss to make bridge with websphere and how?
If not how to do it? I read about servicemix, but things are not very clear. 
I also tried to bridge 2 separate(running on different machines) jboss servers. I added this in my service.xml in my ear (SQUEUE is source queue, and DQUEUE is destination queue - DQUEUE is declared in JS_HOME/server/all/deploy/messaging/destinations-service.xml):

  | <mbean code="org.jboss.jms.server.destination.QueueService"
  | 		name="jboss.messaging.destination:service=Queue,name=SQUEUE"
  | 		xmbean-dd="xmdesc/Queue-xmbean.xml">
  | 		<attribute name="JNDIName">queue/SQUEUE
  | 		</attribute>
  | 		<depends optional-attribute-name="ServerPeer">
  | 			jboss.messaging:service=ServerPeer</depends>
  | 		<depends>jboss.messaging:service=PostOffice
  | 		</depends>
  | 		<attribute name="Clustered">true</attribute>
  | 	</mbean>
  | 
  |    <mbean code="org.jboss.jms.server.bridge.BridgeService"
  |           name="jboss.messaging:service=Bridge,name=TestBridge"
  |           xmbean-dd="xmdesc/Bridge-xmbean.xml">
  |           
  |       <!-- The JMS provider loader that is used to lookup the source destination -->   
  |       <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>     
  |       
  |       <!-- The JMS provider loader that is used to lookup the target destination -->
  |       <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider</depends>    
  |       
  |       <!-- The JNDI lookup for the source destination -->
  |       <attribute name="SourceDestinationLookup">/queue/SQUEUE</attribute> 
  |       
  |       <!-- The JNDI lookup for the target destination -->
  |       <attribute name="TargetDestinationLookup">jnp://192.168.2.104:1099/queue/DQUEUE</attribute>
  |       
  |       <!-- The username to use for the source connection 
  |       <attribute name="SourceUsername">bob</attribute>
  |       -->
  |       
  |       <!-- The password to use for the source connection
  |       <attribute name="SourcePassword">cheesecake</attribute>
  |       -->
  |       
  |       <!-- The username to use for the target connection
  |       <attribute name="TargetUsername">mary</attribute>
  |       -->
  |       
  |       <!-- The password to use for the target connection
  |       <attribute name="TargetPassword">hotdog</attribute>
  |       -->
  |       
  |       <!-- Optional: The Quality Of Service mode to use, one of:
  |            QOS_AT_MOST_ONCE = 0;
  |            QOS_DUPLICATES_OK = 1;
  |            QOS_ONCE_AND_ONLY_ONCE = 2; -->
  |       <attribute name="QualityOfServiceMode">0</attribute>
  |       
  |       <!-- JMS selector to use for consuming messages from the source
  |       <attribute name="Selector">specify jms selector here</attribute>
  |       -->
  |       
  |       <!-- The maximum number of messages to consume from the source before sending to the target -->
  |       <attribute name="MaxBatchSize">1</attribute>     
  |       
  |       <!-- The maximum time to wait (in ms) before sending a batch to the target even if MaxBatchSize is not exceeded.
  |            -1 means wait forever -->   
  |       <attribute name="MaxBatchTime">-1</attribute>
  |       
  |       <!-- If consuming from a durable subscription this is the subscription name
  |       <attribute name="SubName">mysub</attribute>
  |       -->
  |       
  |       <!-- If consuming from a durable subscription this is the client ID to use
  |       <attribute name="ClientID">myClientID</attribute>
  |       -->
  |       
  |       <!-- The number of ms to wait between connection retrues in the event connections to source or target fail -->
  |       <attribute name="FailureRetryInterval">5000</attribute>      
  |       
  |       <!-- The maximum number of connection retries to make in case of failure, before giving up
  |            -1 means try forever-->
  |       <attribute name="MaxRetries">-1</attribute>
  |       
  |     </mbean>
  | 

As you can see i am using RemoteJMSProvider. I do not know if this is correct, but i added the following code in my JB_HOME/server/all/deploy/messaging/jms-ds.xml :

  |  <mbean code="org.jboss.jms.jndi.JMSProviderLoader" 
  |          name="jboss.jms:service=JMSProviderLoader,name=RemoteJMSProvider">      
  | 	<attribute name="ProviderName">RemoteJMSProvider</attribute>      
  | 	<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>      
  | 	<attribute name="FactoryRef">XAConnectionFactory</attribute>      
  | 	<attribute name="QueueFactoryRef">XAConnectionFactory</attribute>      
  | 	<attribute name="TopicFactoryRef">XAConnectionFactory</attribute>      
  | 	<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=192.168.2.104:1099     
  |        </attribute>
  |  </mbean>
  | 

But, nothing happen, i receive error that  this jmsprovider could not be created. If i use JMSProvider for the DQUEUE i get DQUEUE is not bound(it is declared in the second(destination) jboss).
So, how can i send messages to other AS (websphere).
Regards.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4263155#4263155

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4263155



More information about the jboss-dev-forums mailing list