You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by activemq-newbe0911 <co...@ngc.com> on 2013/09/11 20:33:16 UTC

How to avoid message redelivery ActiveMQ 5.8 resource adapter failover

I have deployed a EJB that contains Conumer MDBs with destinationType defined
as "javax.jms.Topic".  
I have deployed ActiveMQ 5.8 Resource Adapter to Glassfish 3.1.1 container
and configure the deployed adapter to connect to the local external broker.
The resource adapter is configured to failover to a remote host failover. 
The ServerURL is defined
as:(tcp://localhost:61616,tcp://remotehost:61616)?randomize=false 
When the localhost broker is disabled or the connection is lost, failover
occurs to the remote host.
Messages are forwarded to the remote host consumer MDB but the localhost
consumer MDB continues to receives the same messages. How can I configure
the resource adapter to forward messages to remote host MDB and not
redeliver the messages localhost MDB?
I'm using activemq resource adapter 5.8 and glassfish 3.1.1
The following snippet is from my producer code:
...
String consumerActiveMQTopicConnFactory = (String)
jndiContext.lookup("resource/myConsumerActiveMQTopicConnectionFactory");
TopicConnectionFactory connectionFactory = (TopicConnectionFactory)
jndiContext.lookup(consumerActiveMQTopicConnFactory);
connection = connectionFactory.createTopicConnection();
connection.start();
TopicSession session = connection.createTopicSession(false,
Session.AUTO_ACKNOWLEDGE);
String consumerActiveMQTopic = (String)
jndiContext.lookup("resource/myConsumerrActiveMQTopic");
Destination  destination = session.createTopic(consumerActiveMQTopic );
MessageProducer messageProducer = session.createProducer(destination);
messageProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
sendMessagesToTopic(session, messageProducer);
.....









--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-avoid-message-redelivery-ActiveMQ-5-8-resource-adapter-failover-tp4671423.html
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.