activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Problem with slave broker
Date Mon, 24 Jul 2006 06:54:06 GMT
On 6/6/06, dhurlburtusa <danny@realgo.com> wrote:
>
> First of all, is the master/slave broker setup recommended for a production
> use?

Yes

> If not, what is usually recommended? Network of brokers?
>
> If so, here is the problem I am having with a master/slave setup:

Which version of ActiveMQ are you using?


> I get the following stack trace from the slave broker when a message is
> produced:
> INFO  Service                        - Async error occurred:
> java.lang.NullPointerException
> java.lang.NullPointerException
>         at
> org.apache.activemq.broker.TransactionBroker.beginTransaction(TransactionBroker.java:136)
>         at
> org.apache.activemq.broker.BrokerFilter.beginTransaction(BrokerFilter.java:117)
>         at
> org.apache.activemq.broker.BrokerFilter.beginTransaction(BrokerFilter.java:117)
>         at
> org.apache.activemq.broker.MutableBrokerFilter.beginTransaction(MutableBrokerFilter.java:130)
>         at
> org.apache.activemq.broker.AbstractConnection.processBeginTransaction(AbstractConnection.java:274)
>         at
> org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:92)
>         at
> org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:201)
>         at
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
>         at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
>         at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
>         at
> org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:76)
>         at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44)
>         at
> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
>         at
> org.apache.activemq.broker.ft.MasterConnector.serviceRemoteCommand(MasterConnector.java:204)
>         at
> org.apache.activemq.broker.ft.MasterConnector$2.onCommand(MasterConnector.java:99)
>         at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
>         at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
>         at
> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
>         at
> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
>         at
> org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
>         at java.lang.Thread.run(Thread.java:595)
>
> When the message is consumed I get the following stack trace:
> INFO  Service                        - Async error occurred:
> java.lang.IllegalStateException: Cannot lookup a consumer from a connection
> that had not been registered: ID:Nacho-1863-1149541385203-0:0
> java.lang.IllegalStateException: Cannot lookup a consumer from a connection
> that had not been registered: ID:Nacho-1863-1149541385203-0:0
>         at
> org.apache.activemq.broker.AbstractConnection.lookupConnectionState(AbstractConnection.java:223)
>         at
> org.apache.activemq.broker.AbstractConnection.processMessageAck(AbstractConnection.java:356)
>         at org.apache.activemq.command.MessageAck.visit(MessageAck.java:178)
>         at
> org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:201)
>         at
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
>         at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
>         at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
>         at
> org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:76)
>         at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44)
>         at
> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
>         at
> org.apache.activemq.broker.ft.MasterConnector.serviceRemoteCommand(MasterConnector.java:204)
>         at
> org.apache.activemq.broker.ft.MasterConnector$2.onCommand(MasterConnector.java:99)
>         at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
>         at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
>         at
> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
>         at
> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
>         at
> org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
>         at java.lang.Thread.run(Thread.java:595)
> INFO  Service                        - Async error occurred:
> java.lang.NullPointerException
> java.lang.NullPointerException
>         at
> org.apache.activemq.broker.TransactionBroker.getTransaction(TransactionBroker.java:218)
>         at
> org.apache.activemq.broker.TransactionBroker.commitTransaction(TransactionBroker.java:152)
>         at
> org.apache.activemq.broker.BrokerFilter.commitTransaction(BrokerFilter.java:81)
>         at
> org.apache.activemq.broker.BrokerFilter.commitTransaction(BrokerFilter.java:81)
>         at
> org.apache.activemq.broker.MutableBrokerFilter.commitTransaction(MutableBrokerFilter.java:94)
>         at
> org.apache.activemq.broker.AbstractConnection.processCommitTransactionOnePhase(AbstractConnection.java:302)
>         at
> org.apache.activemq.command.TransactionInfo.visit(TransactionInfo.java:98)
>         at
> org.apache.activemq.broker.AbstractConnection.service(AbstractConnection.java:201)
>         at
> org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:62)
>         at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
>         at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
>         at
> org.apache.activemq.transport.vm.VMTransport.oneway(VMTransport.java:76)
>         at
> org.apache.activemq.transport.MutexTransport.oneway(MutexTransport.java:44)
>         at
> org.apache.activemq.transport.ResponseCorrelator.oneway(ResponseCorrelator.java:60)
>         at
> org.apache.activemq.broker.ft.MasterConnector.serviceRemoteCommand(MasterConnector.java:204)
>         at
> org.apache.activemq.broker.ft.MasterConnector$2.onCommand(MasterConnector.java:99)
>         at
> org.apache.activemq.transport.ResponseCorrelator.onCommand(ResponseCorrelator.java:97)
>         at
> org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:63)
>         at
> org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:114)
>         at
> org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:122)
>         at
> org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:87)
>         at
> org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:143)
>         at java.lang.Thread.run(Thread.java:595)
>
> I am using the ActiveMQ 4.0 release, Jencks 1.1.2, Spring 1.2, Tomcat 5.0.
>
> Here are broker configuration files:
>
> Master Config:
> <beans xmlns="http://activemq.org/config/1.0">
>   <broker brokerName="master">
>     <transportConnectors>
>        <transportConnector name="masterTransportConnector"
> uri="tcp://localhost:61616"/>
>     </transportConnectors>
>   </broker>
> </beans>
>
> Slave Config:
> <beans xmlns="http://activemq.org/config/1.0">
>   <broker brokerName="slave" masterConnectorURI="tcp://localhost:61616"
> shutdownOnMasterFailure="false">
>     <transportConnectors>
>        <transportConnector name="slaveTransportConnector"
> uri="tcp://localhost:61617"/>
>     </transportConnectors>
>   </broker>
> </beans>
>
> Client Config:
> <beans>
>     <bean id="activeMQResourceAdapter"
> class="org.apache.activemq.ra.ActiveMQResourceAdapter">
>         <property name="serverUrl"
> value="failover://(tcp://localhost:61616,tcp://localhost:61617)?randomize=false"/>
>     </bean>
>
>     <bean id="transactionManagerImpl"
> class="org.jencks.factory.TransactionManagerFactoryBean">
>         <property name="defaultTransactionTimeoutSeconds" value="600"/>
>         <property name="transactionLog">
>             <bean
> class="org.apache.geronimo.transaction.log.UnrecoverableLog"/>
>         </property>
>     </bean>
>
>     <bean id="transactionContextManager"
> class="org.jencks.factory.TransactionContextManagerFactoryBean">
>         <property name="transactionManager" ref="transactionManagerImpl"/>
>     </bean>
>
>     <bean id="connectionTracker"
> class="org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator"/>
>
>     <bean id="userTransaction"
> class="org.jencks.factory.UserTransactionFactoryBean">
>         <property name="transactionContextManager"
> ref="transactionContextManager"/>
>         <property name="connectionTrackingCoordinator"
> ref="connectionTracker"/>
>     </bean>
>
>     <bean id="transactionSupport"
> class="org.jencks.factory.XATransactionFactoryBean">
>         <property name="useTransactionCaching" value="true"/>
>         <property name="useThreadCaching" value="false"/>
>     </bean>
>
>     <bean id="poolingSupport"
> class="org.jencks.factory.SinglePoolFactoryBean">
>         <property name="maxSize" value="2"/>
>         <property name="minSize" value="1"/>
>         <property name="blockingTimeoutMilliseconds" value="60"/>
>         <property name="idleTimeoutMinutes" value="60"/>
>         <property name="matchOne" value="true"/>
>         <property name="matchAll" value="true"/>
>         <property name="selectOneAssumeMatch" value="true"/>
>     </bean>
>
>     <bean id="jmsConnectionManager"
> class="org.jencks.factory.ConnectionManagerFactoryBean">
>         <property name="transactionSupport" ref="transactionSupport"/>
>         <property name="poolingSupport" ref="poolingSupport"/>
>         <property name="transactionContextManager"
> ref="transactionContextManager"/>
>         <property name="connectionTracker" ref="connectionTracker"/>
>     </bean>
>
>     <bean id="jmsManagedConnectionFactory"
> class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
>         <property name="resourceAdapter" ref="activeMQResourceAdapter"/>
>     </bean>
>
>     <bean id="jmsConnectionFactory"
> class="org.springframework.jca.support.LocalConnectionFactoryBean">
>         <property name="managedConnectionFactory"
> ref="jmsManagedConnectionFactory"/>
>         <property name="connectionManager" ref="jmsConnectionManager"/>
>     </bean>
>
>     <bean id="transactionManager"
> class="org.springframework.transaction.jta.JtaTransactionManager">
>         <property name="userTransaction" ref="userTransaction"/>
>         <property name="transactionManager" ref="transactionManagerImpl"/>
>     </bean>
>
>     <!-- Spring JMS Template -->
>     <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
>         <property name="connectionFactory">
>             <ref local="jmsConnectionFactory"/>
>                 <property name="targetConnectionFactory"
> ref="pooledConnectionFactory" />
>             </bean-->
>         </property>
>         <property name="explicitQosEnabled" value="false">
>             <description>
>                 Set if the QOS values (deliveryMode, priority, timeToLive)
>                 should be used for sending a message.
>             </description>
>         </property>
>         <property name="deliveryPersistent" value="true">
>             <description>
>                 Alternatively, set this property instead of the deliveryMode
>                 property.
>             </description>
>         </property>
>     </bean>
>
>     <bean id="notificationService"
> class="com.company.messaging.impl.NotificationServiceImpl">
>         <property name="jmsTemplate" ref="jmsTemplate"/>
>         <property name="destination" ref="destination"/>
>     </bean>
>
>     <bean id="jmsJcaContainer" class="org.jencks.JCAContainer">
>         <property name="bootstrapContext">
>             <bean class="org.jencks.factory.BootstrapContextFactoryBean">
>                 <property name="threadPoolSize" value="25"/>
>             </bean>
>         </property>
>
>         <property name="resourceAdapter" ref="activeMQResourceAdapter"/>
>     </bean>
>
>     <bean id="notificationMessageConsumer" class="org.jencks.JCAConnector">
>         <description>
>             Must set either the endpointFactory or ref properties.
>         </description>
>         <property name="jcaContainer" ref="jmsJcaContainer">
>             <description>
>                 Alternative to setting the bootstrapContext and
> resourceAdapter
>                 properties.
>             </description>
>         </property>
>         <property name="activationSpec">
>             <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
>                 <property name="activeMQDestination" ref="destination">
>                 </property>
>             </bean>
>         </property>
>         <property name="ref" value="notificationListener"/>
>     </bean>
>
>     <bean id="notificationListener"
> class="com.company.messaging.impl.NotificationListenerImpl">
>         <property name="daoFactory" ref="daoFactory"/>
>     </bean>
>
> </beans>
>
> Any help is greatly appreciated. Let me know if you need more information.
>
> Thanks,
>
> Dan
> --
> View this message in context: http://www.nabble.com/Problem-with-slave-broker-t1738373.html#a4724171
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message