activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skomarla <skoma...@yahoo.com>
Subject Master/Slave JDBC persistence using embedded broker in JBoss
Date Mon, 28 Jul 2008 20:30:43 GMT

Hello,

I'm having trouble getting a master slave setup working using an embedded
broker in JBoss with JDBC persistence. I've done some searching to see if
there is a workaround, but the only thing i've seen seems to be to either
run master/slave separately, which is what I'm trying to avoid.

The overview of the architecture is this.  
1) There will be multiple JBoss instances each hosting a spring based
application, which contain JMS listeners (using the spring's
org.springframework.jms.listener.DefaultMessageListenerContainer).  
2) In order to keep the deployment as simple as possible, we have decided to
use the embedded activemq broker and have each node use the in vm transport
protocol.
3) I'm using activemq 5.1.0, and so I don't have a problem with the slave
node completing its startup sequence.

My problem occurs when my spring based application deploys.  
- The master node completes its start up sequence and the application
deploys.  
- The slave node complete's startup sequence without blocking, but when the
application deploys, the DefaultMessageListenerContainer repeatedly tries to
connect to the broker.  This fails with the below exception. (seemingly
because the slave has not started its transport connectors which it seems to
only do so when it becomes a master)

2008-07-28 15:51:00,085 WARN 
[org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable
while attempting to get a new connection: null
javax.resource.ResourceException: Could not create connection.
	at
org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:171)
	at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
	at
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
	at
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:538)
	at
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
	at
org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
	at
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
	at
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
	at
org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:94)
	at
org.apache.activemq.ra.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:67)
	at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:184)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.access$100(AbstractPollingMessageListenerContainer.java:76)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer$MessageListenerContainerResourceFactory.createConnection(AbstractPollingMessageListenerContainer.java:496)
	at
org.springframework.jms.connection.ConnectionFactoryUtils.doGetTransactionalSession(ConnectionFactoryUtils.java:279)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:282)
	at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:237)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:868)
	at java.lang.Thread.run(Thread.java:595)
Caused by: javax.jms.JMSException: Could not create Transport. Reason:
java.io.IOException: Server TransportAcceptListener is null.
	at
org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:35)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:237)
	at
org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:250)
	at
org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:177)
	at
org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:79)
	at
org.apache.activemq.ra.ActiveMQConnectionSupport.makeConnection(ActiveMQConnectionSupport.java:61)
	at
org.apache.activemq.ra.ActiveMQManagedConnectionFactory.createManagedConnection(ActiveMQManagedConnectionFactory.java:169)
	... 18 more
Caused by: java.io.IOException: Server TransportAcceptListener is null.
	at
org.apache.activemq.transport.vm.VMTransportServer.connect(VMTransportServer.java:72)
	at
org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:140)
	at
org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:53)
	at
org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:47)
	at
org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:76)
	at
org.apache.activemq.ActiveMQConnectionFactory.createTransport(ActiveMQConnectionFactory.java:235)
	... 23 more


My understanding of the embedded broker is that when a broker is a slave, it
will forward all to the master broker.  My goal is to have each jboss node
be in the position to produce messages into a persistent queue and consume
message from the queue without needing to know that they are connected to a
master or slave.

I know that I can specifically list all the brokers using the failover
protocol, but that would seem to negate the benefit of an in-vm protocol. 
My broker-config.xml files are attached.

Any help would be greatly appreciated.

Thank you.
-Sharath

http://www.nabble.com/file/p18698970/broker2.xml broker2.xml 
http://www.nabble.com/file/p18698970/broker1.xml broker1.xml 
-- 
View this message in context: http://www.nabble.com/Master-Slave-JDBC-persistence-using-embedded-broker-in-JBoss-tp18698970p18698970.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message