activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sunny d <innocentsunn...@gmail.com>
Subject steps to connect to ActiveMQ Topic/Queue from Remote MDB on jboss
Date Sun, 21 Feb 2010 19:21:14 GMT

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.


Mime
View raw message