activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher G. Stach II" <...@ldsys.net>
Subject Re: rollbacks not working (4.0RC3)
Date Thu, 18 May 2006 16:35:44 GMT
Christopher G. Stach II wrote:
> With 4.0 (release), I can't get it to deadlock anymore, but
> rollback->redelivery still doesn't work.  Instead, I get a bunch of these:
...
> 	<bean id="jms.resourceAdapter"
> class="org.apache.activemq.ra.ActiveMQResourceAdapter"
> depends-on="jms.broker">
> 		<property name="initialRedeliveryDelay">
> 			<value>2000</value>
> 		</property>
> 
> 		<property name="maximumRedeliveries">
> 			<value>10</value>
> 		</property>
> 
> 		<property name="redeliveryBackOffMultiplier">
> 			<value>2</value>
> 		</property>
> 
> 		<property name="serverUrl">
> 			<value>vm://localhost</value>
> 		</property>
> 	</bean>
> 

Okay, I changed the RA settings to this:

	<bean id="jms.resourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter"
depends-on="jms.broker">
		<property name="allPrefetchValues">
			<value>1</value>
		</property>

		<property name="initialRedeliveryDelay">
			<value>2000</value>
		</property>

		<property name="maximumRedeliveries">
			<value>9</value>
		</property>

		<property name="redeliveryBackOffMultiplier">
			<value>2</value>
		</property>

		<property name="redeliveryUseExponentialBackOff">
			<value>true</value>
		</property>

		<property name="serverUrl">
			<value>vm://localhost</value>
		</property>
	</bean>

My testing has been consisting of this:

* Send in three messages
* Each MD POJO sleeps until an even minute passes
* All three messages are processed at the same time
* Two optimistic lock failures are expected to happen
* Two rollbacks are expected to occur

Before this change, I was getting two rollbacks and none of the messages
were redelivered.  Now, after the prefetch mods, one of the two failed
messages is retried, but I get this exception:

org.apache.activemq.ra.ActiveMQEndpointWorker.reconnect Endpoint
connection to JMS broker failed: Could not correlate acknowledgment
 with dispatched message: MessageAck {commandId = 177, responseRequired
= false, ackType = 1, consumerId = ID:xxxx-1995-1147968
880850-2:5:-1:2, firstMessageId = ID:xxxx-1995-1147968880850-2:1:1:1:2,
lastMessageId = ID:xxxx-1995-1147968880850-2:1:1:1
:2, destination = queue://xxxQueue, transactionId = null, messageCount = 1}
org.apache.activemq.ra.ActiveMQEndpointWorker.reconnect Endpoint will
try to reconnect to the JMS broker in 30 seconds

and these a bit later:

org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke
Processing of JmsServiceExporterMessageListener remote
call resulted in fatal exception: com.foo.ProcessorFacade.processLead
org.apache.activemq.ConnectionClosedException: The connection is already
closed
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1127)
        at
org.apache.activemq.TransactionContext.setXid(TransactionContext.java:550)
        at
org.apache.activemq.TransactionContext.end(TransactionContext.java:327)
        at
org.apache.activemq.ra.LocalAndXATransaction.end(LocalAndXATransaction.java:89)
        at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.end(WrapperNamedXAResource.java:51)
...

org.apache.activemq.ra.ServerSessionImpl.run Endpoint failed to process
message. Reason: java.lang.NullPointerException

org.apache.activemq.ra.ActiveMQEndpointWorker.reconnect Endpoint
connection to JMS broker failed: Could not correlate acknowledgment
 with dispatched message: MessageAck {commandId = 178, responseRequired
= false, ackType = 1, consumerId = ID:xxxx-1995-1147968
880850-2:5:-1:2, firstMessageId = ID:xxxx-1995-1147968880850-2:1:1:1:2,
lastMessageId = ID:xxxx-1995-1147968880850-2:1:1:1
:2, destination = queue://xxxQueue, transactionId = null, messageCount = 1}
org.apache.activemq.ra.ActiveMQEndpointWorker.reconnect Endpoint will
try to reconnect to the JMS broker in 30 seconds

Is there another simple configuration setting somewhere to magically
make this work?  If so, it's not very intuitive.  This should "just work."

-- 
Christopher G. Stach II

Mime
View raw message