You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sunny d <in...@gmail.com> on 2010/02/21 20:21:14 UTC

steps to connect to ActiveMQ Topic/Queue from Remote MDB on jboss

I have activeMQ running on one Jboss server(AS4.2.3) following the steps
provided
here.http://activemq.apache.org/integrating-apache-activemq-with-jboss.html.
The things work fine locally.

>From another Jboss server an MDB needs to listen to messages on the remote
Destination(Topic).Can someone please provide me the steps.

I have figured out following  way of doing it. Is it the right approach and
if there is a better way please provide the steps..
I tried the normal mbean way of connecting to a remote MDB in Jboss. But it
didn't work  .It works fine with JBoss MQ and MDB.

 

@MessageDriven(name="MessageConsumer", activationConfig = {
        @ActivationConfigProperty(propertyName="destinationType",
propertyValue="javax.jms.Queue"),
        @ActivationConfigProperty(propertyName="destination",
propertyValue="topic/remoteTopic")       
       // @ActivationConfigProperty(propertyName="providerAdapterJNDI",
propertyValue="java:/RemoteJMSProvider")       
    })
@ResourceAdapter("active-mq.rar")
public class MessageConsumerBean implements MessageListener {

    @Resource
    public MessageDrivenContext mdc;

    public void onMessage(Message message) {           
        if(message instanceof ObjectMessage)
        {
            try {               
                Object obj = ((ObjectMessage)message).getObject();
                // do processing
            } catch (JMSException e) {
            }                   
        }
    }
}
/*
         Changing the resourceadapter/config-property of ra.xml of
activemq.rar(in deploy folder) on MDB server to point to the remote machine
running active mq

 

        <config-property> 
             <config-property-name>ServerUrl</config-property-name> 
            <config-property-type>java.lang.String</config-property-type> 
            
<config-property-value>tcp://remActiveMQOnJbossServerAddress:61616</config-property-value> 
         </config-property> 
*/
-- 
View this message in context: http://old.nabble.com/steps-to-connect-to-ActiveMQ-Topic-Queue-from-Remote-MDB-on-jboss-tp27676882p27676882.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.