You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Christopher G. Stach II" <cg...@ldsys.net> on 2006/05/02 21:11:03 UTC

Re: rollbacks not working (4.0RC3)

Christopher G. Stach II wrote:
> Hiram Chirino wrote:
>> Hi Christopher,
>>
>> I just committed a patch that should resolve the deadlock you posted. 
>> If you get a chance could confirm if it works for you?
>>
>> --
>> Regards,
>> Hiram
> 
> Will do once the next snapshot is up.  Thanks!
> 

Hiram:

Is this change contained in RC3?  I haven't had time to test since I
found that deadlock, but I think I can do it this week.

-- 
Christopher G. Stach II

Re: rollbacks not working (4.0RC3)

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
John Pederzolli wrote:
> What (if any) JCA container are you using?
> 
> I had issues very similar to this until I switched from Jencks 1.1.3 to
> Spring 2.0's JMS listener implementation.
> 
> - John
> --
> View this message in context: http://www.nabble.com/rollbacks-not-working-%284.0RC3%29-t1440340.html#a4461367
> Sent from the ActiveMQ - User forum at Nabble.com.
> 

Jencks 1.1.1.  I wouldn't be surprised if it was the culprit. :)  I will
try and see if Spring 2.0 doesn't affect the rest of the app and if it
works.  Thanks for the suggestion!

-- 
Christopher G. Stach II

Re: rollbacks not working (4.0RC3)

Posted by Hiram Chirino <hi...@hiramchirino.com>.
Sounds like it could be a bug.  Please file a JIRA bug report:
http://issues.apache.org/activemq/browse/AMQ

If a small test case accompanied that bug report, it would expedite
figuring out what's happening.


On 5/24/06, Christopher G. Stach II <cg...@ldsys.net> wrote:
> Christopher G. Stach II wrote:
> > org.apache.activemq.broker.AbstractConnection.serviceException Async
> > error occurred: javax.jms.JMSException: Could not correlate
> > acknowledgment with dispatched message: MessageAck {commandId = 137,
>
> James:
>
> I don't quite understand this.  According to
> http://www.activemq.org/site/message-redelivery-and-dlq-handling.html, a
> poison ack is only sent when all redelivery attempts have failed.  I
> have redelivery configured in two places, on the client side on the MCF
> (the location where that wiki page states it should be) and on the RA to
> be sure, but the poison ack comes back immediately.  I get no
> redeliveries at all.
>
>         <bean id="jms.connectionFactory"
> class="org.springframework.jca.support.LocalConnectionFactoryBean">
>                 <property name="connectionManager">
>                         <bean class="com.xxx.jca.ResinConnectionManagerFactoryBean">
>                                 <property name="localTransaction">
>                                         <value>false</value>
>                                 </property>
>
>                                 <property name="localTransactionOptimization">
>                                         <value>false</value>
>                                 </property>
>
>                                 <property name="managedConnectionFactory">
>                                         <ref local="jms.managedConnectionFactory" />
>                                 </property>
>
>                                 <property name="xaTransaction">
>                                         <value>true</value>
>                                 </property>
>                         </bean>
>                 </property>
>
>                 <property name="managedConnectionFactory">
>                         <ref local="jms.managedConnectionFactory" />
>                 </property>
>         </bean>
>
>         <bean id="jms.jcaContainer" class="org.jencks.JCAContainer">
>                 <property name="bootstrapContext">
>                         <bean class="com.xxx.jca.ResinBootstrapContextFactoryBean" />
>                 </property>
>
>                 <property name="resourceAdapter">
>                         <ref local="jms.resourceAdapter" />
>                 </property>
>         </bean>
>
>         <bean id="jms.managedConnectionFactory"
> class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
>                 <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="resourceAdapter">
>                         <ref local="jms.resourceAdapter" />
>                 </property>
>         </bean>
>
>         <bean id="jms.broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
>                 <property name="config">
>                         <value>classpath:activemq.xml</value>
>                 </property>
>
>                 <property name="start">
>                         <value>true</value>
>                 </property>
>         </bean>
>
>         <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>
>
> Is this just misconfiguration or a bug?  It's preventing us from moving
> forward at all with 4.0.
>
> --
> Christopher G. Stach II
>


-- 
Regards,
Hiram

Re: Multiple Consumers

Posted by Adrian Co <ac...@exist.com>.
Hi,

I'm not sure if this is what you are looking for:
http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MessageConsumer.html#setMessageListener(javax.jms.MessageListener)
http://java.sun.com/j2ee/1.4/docs/api/javax/jms/MessageListener.html

You can set a message listener for each consumer, and the onMessage 
method for each consumer will be called whenever a message arrives that 
is targeted to that consumer. If you download the source code of 
ActiveMQ, we have a lot of unit test cases that provides a lot of 
example on using JMS and ActiveMQ.

Welcome to the messaging community, btw. :)

Regards,
Adrian Co

Benjamin Wootton wrote:

>** Apologies if this came through yesterday.  I sent it once but don't
>think it left my outbox! **
>
>I'm new to messaging so forgive me if this is a silly question.
>
>I would like a number of in-process consumers subscribing to different
>topics.
>
>Whenever one of these topics ticks, I would like to callback to a Java
>method.
>
>What is the right idiom for doing this?  Something like the following is
>fine in the scenario where we only have a single consumer:
>
>while ( ( message = consumer.receive( 10000 )  ) != null )
>{                                
>     processMessage( message );
>}
>
>But clearly isn't what we need where we have multiple consumers.
>
>I've considered placing each consumer in it's own thread, but I'd like
>the callback to be called in a deterministic order (ie the same order
>that the message arrives in.)  The semantics of the avaialble receive
>methods also don't seem to fit with doing this.
>
>                new Thread()
>                {  
>                    public void run()
>                    {  
>                        try
>                        {
>                            Message message;
>                            while ( ( message = consumer.receive(
>                            1000000 )  ) != null )
>                            {                                
>                                processMessage( message );
>                            }
>                        }
>                        catch( Exception exception )
>                        {
>                            exception.printStackTrace();
>                        }
>                    }
>                }.start();  
>
>Is there any example code around for this?
>
>Thanks in advance
>Ben
>  
>


Multiple Consumers

Posted by Benjamin Wootton <be...@ftml.net>.
** Apologies if this came through yesterday.  I sent it once but don't
think it left my outbox! **

I'm new to messaging so forgive me if this is a silly question.

I would like a number of in-process consumers subscribing to different
topics.

Whenever one of these topics ticks, I would like to callback to a Java
method.

What is the right idiom for doing this?  Something like the following is
fine in the scenario where we only have a single consumer:

while ( ( message = consumer.receive( 10000 )  ) != null )
{                                
     processMessage( message );
}

But clearly isn't what we need where we have multiple consumers.

I've considered placing each consumer in it's own thread, but I'd like
the callback to be called in a deterministic order (ie the same order
that the message arrives in.)  The semantics of the avaialble receive
methods also don't seem to fit with doing this.

                new Thread()
                {  
                    public void run()
                    {  
                        try
                        {
                            Message message;
                            while ( ( message = consumer.receive(
                            1000000 )  ) != null )
                            {                                
                                processMessage( message );
                            }
                        }
                        catch( Exception exception )
                        {
                            exception.printStackTrace();
                        }
                    }
                }.start();  

Is there any example code around for this?

Thanks in advance
Ben
-- 
  Benjamin Wootton
  benwootton@ftml.net


Re: rollbacks not working (4.0RC3)

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
Christopher G. Stach II wrote:
> org.apache.activemq.broker.AbstractConnection.serviceException Async
> error occurred: javax.jms.JMSException: Could not correlate
> acknowledgment with dispatched message: MessageAck {commandId = 137,

James:

I don't quite understand this.  According to
http://www.activemq.org/site/message-redelivery-and-dlq-handling.html, a
poison ack is only sent when all redelivery attempts have failed.  I
have redelivery configured in two places, on the client side on the MCF
(the location where that wiki page states it should be) and on the RA to
be sure, but the poison ack comes back immediately.  I get no
redeliveries at all.

	<bean id="jms.connectionFactory"
class="org.springframework.jca.support.LocalConnectionFactoryBean">
		<property name="connectionManager">
			<bean class="com.xxx.jca.ResinConnectionManagerFactoryBean">
				<property name="localTransaction">
					<value>false</value>
				</property>

				<property name="localTransactionOptimization">
					<value>false</value>
				</property>

				<property name="managedConnectionFactory">
					<ref local="jms.managedConnectionFactory" />
				</property>

				<property name="xaTransaction">
					<value>true</value>
				</property>
			</bean>
		</property>

		<property name="managedConnectionFactory">
			<ref local="jms.managedConnectionFactory" />
		</property>
	</bean>

	<bean id="jms.jcaContainer" class="org.jencks.JCAContainer">
		<property name="bootstrapContext">
			<bean class="com.xxx.jca.ResinBootstrapContextFactoryBean" />
		</property>

		<property name="resourceAdapter">
			<ref local="jms.resourceAdapter" />
		</property>
	</bean>

	<bean id="jms.managedConnectionFactory"
class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
		<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="resourceAdapter">
			<ref local="jms.resourceAdapter" />
		</property>
	</bean>

	<bean id="jms.broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
		<property name="config">
			<value>classpath:activemq.xml</value>
		</property>

		<property name="start">
			<value>true</value>
		</property>
	</bean>

	<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>

Is this just misconfiguration or a bug?  It's preventing us from moving
forward at all with 4.0.

-- 
Christopher G. Stach II

Re: rollbacks not working (4.0RC3)

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
Christopher G. Stach II wrote:
> I upgraded to Jencks 1.1.3 from 1.1.1.  Now it at least delivers a
> message and the transaction can commit properly, but still doesn't
> rollback properly.
> 

Oh, forgot the stack traces!

I get the deadlock exception which looks like a normal DB deadlock.
Then, as in the previous posts, four of these, each with an incremented
commandId:

org.apache.activemq.broker.AbstractConnection.serviceException Async
error occurred: javax.jms.JMSException: Could not correlate
acknowledgment with dispatched message: MessageAck {commandId = 137,
responseRequired = false, ackType = 1, consumerId =
ID:xxx-2276-1148335783189-2:5:-1:2, firstMessageId =
ID:xxx-2276-1148335783189-2:1:1:1:2, lastMessageId =
ID:xxx-2276-1148335783189-2:1:1:1:2, destination = queue://xxxQueue,
transactionId = null, messageCount = 1}
javax.jms.JMSException: Could not correlate acknowledgment with
dispatched message: MessageAck {commandId = 137, responseRequired =
false, ackType = 1, consumerId = ID:xxx-2276-1148335783189-2:5:-1:2,
firstMessageId = ID:xxx-2276-1148335783189-2:1:1:1:2, lastMessageId =
ID:xxx-2276-1148335783189-2:1:1:1:2, destination = queue://xxxQueue,
transactionId = null, messageCount = 1}
        at
org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:175)
        at
org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:233)
        at
org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:362)
        at
org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:176)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:65)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:65)
        at
org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:78)
        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.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1111)
        at
org.apache.activemq.ActiveMQSession.asyncSendPacket(ActiveMQSession.java:1655)
        at
org.apache.activemq.ActiveMQSession$2.afterRollback(ActiveMQSession.java:720)
        at
org.apache.activemq.TransactionContext.afterRollback(TransactionContext.java:134)
        at
org.apache.activemq.TransactionContext.rollback(TransactionContext.java:409)
        at
org.apache.activemq.ra.LocalAndXATransaction.rollback(LocalAndXATransaction.java:126)
        at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:78)
        at
com.caucho.transaction.TransactionImpl.rollbackInt(TransactionImpl.java:787)
        at
com.caucho.transaction.TransactionImpl.commit(TransactionImpl.java:560)
        at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
        at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:125)
        at
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:64)
        at
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:214)
        at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:751)
        at
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
        at com.caucho.jca.WorkThread.run(WorkThread.java:99)
        at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
        at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
        at java.lang.Thread.run(Thread.java:595)

Those are the ones that bother me, since it's during the rollback.  Then
there's an understanbable ConnectionClosedException and this:

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

I think that might have been fixed for 4.1, though.

-- 
Christopher G. Stach II

Re: rollbacks not working (4.0RC3)

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
James Strachan wrote:
> On 5/19/06, John Pederzolli <jp...@gmail.com> wrote:
>>
>> What (if any) JCA container are you using?
>>
>> I had issues very similar to this until I switched from Jencks 1.1.3 to
>> Spring 2.0's JMS listener implementation.
> 
> FWIW Spring 2.0 is not a JCA container nor does it reuse the JCA
> Resource Adapters of JMS providers. So if it works in Spring 2.0 it
> means it could be Jencks or an issue with ActiveMQ's Resource Adapter.
> 

After a bunch of mucking around, DefaultMessageListenerContainer works
for a simple, successful transaction.  However, it turned out that it
wasn't enlisting the JMS connection in the XA transaction.  It didn't
work during a deadlock and rollback.  I was still using the AMQ RA via
ActiveMQManagedConnectionFactory and
org.springframework.jca.support.LocalConnectionFactoryBean, the same as
with Jencks.  Either Spring is broken, or there's some magical way to
wire it up.

I upgraded to Jencks 1.1.3 from 1.1.1.  Now it at least delivers a
message and the transaction can commit properly, but still doesn't
rollback properly.

-- 
Christopher G. Stach II

Re: rollbacks not working (4.0RC3)

Posted by James Strachan <ja...@gmail.com>.
On 5/19/06, John Pederzolli <jp...@gmail.com> wrote:
>
> What (if any) JCA container are you using?
>
> I had issues very similar to this until I switched from Jencks 1.1.3 to
> Spring 2.0's JMS listener implementation.

FWIW Spring 2.0 is not a JCA container nor does it reuse the JCA
Resource Adapters of JMS providers. So if it works in Spring 2.0 it
means it could be Jencks or an issue with ActiveMQ's Resource Adapter.

-- 

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

Re: rollbacks not working (4.0RC3)

Posted by John Pederzolli <jp...@gmail.com>.
What (if any) JCA container are you using?

I had issues very similar to this until I switched from Jencks 1.1.3 to
Spring 2.0's JMS listener implementation.

- John
--
View this message in context: http://www.nabble.com/rollbacks-not-working-%284.0RC3%29-t1440340.html#a4461367
Sent from the ActiveMQ - User forum at Nabble.com.


Re: rollbacks not working (4.0RC3)

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
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

Re: rollbacks not working (4.0RC3)

Posted by "Christopher G. Stach II" <cg...@ldsys.net>.
Hiram Chirino wrote:
> No,
> 
> I think you will need a more recent snapshot than RC3
> 

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:

org.apache.activemq.broker.AbstractConnection.serviceException Async
error occurred: javax.jms.JMSException: Could not correlate
acknowledgment with dispatched message: MessageAck {commandId = 193,
responseRequired = false, ackType = 1, consumerId =
ID:xxx-3212-1147892645742-2:5:-1:2, firstMessageId =
ID:xxx-3212-1147892645742-2:1:1:1:4, lastMessageId =
ID:xxx-3212-1147892645742-2:1:1:1:4, destination = queue://xxx,
transactionId = null, messageCount = 1}
javax.jms.JMSException: Could not correlate acknowledgment with
dispatched message: MessageAck {commandId = 193, responseRequired =
false, ackType = 1, consumerId = ID:xxx-3212-1147892645742-2:5:-1:2,
firstMessageId = ID:xxx-3212-1147892645742-2:1:1:1:4, lastMessageId =
ID:xxx-3212-1147892645742-2:1:1:1:4, destination = queue://xxxx,
transactionId = null, messageCount = 1}
        at
org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:175)
        at
org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:233)
        at
org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:362)
        at
org.apache.activemq.broker.TransactionBroker.acknowledge(TransactionBroker.java:176)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:65)
        at
org.apache.activemq.broker.BrokerFilter.acknowledge(BrokerFilter.java:65)
        at
org.apache.activemq.broker.MutableBrokerFilter.acknowledge(MutableBrokerFilter.java:78)
        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.ActiveMQConnection.asyncSendPacket(ActiveMQConnection.java:1111)
        at
org.apache.activemq.ActiveMQSession.asyncSendPacket(ActiveMQSession.java:1655)
        at
org.apache.activemq.ActiveMQSession$2.afterRollback(ActiveMQSession.java:720)
        at
org.apache.activemq.TransactionContext.afterRollback(TransactionContext.java:134)
        at
org.apache.activemq.TransactionContext.rollback(TransactionContext.java:409)
        at
org.apache.activemq.ra.LocalAndXATransaction.rollback(LocalAndXATransaction.java:126)
        at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:78)
        at
com.caucho.transaction.TransactionImpl.rollbackInt(TransactionImpl.java:787)
        at
com.caucho.transaction.TransactionImpl.commit(TransactionImpl.java:560)
        at org.jencks.XAEndpoint.afterDelivery(XAEndpoint.java:103)
        at
org.apache.activemq.ra.MessageEndpointProxy$MessageEndpointAlive.afterDelivery(MessageEndpointProxy.java:125)
        at
org.apache.activemq.ra.MessageEndpointProxy.afterDelivery(MessageEndpointProxy.java:64)
        at
org.apache.activemq.ra.ServerSessionImpl.afterDelivery(ServerSessionImpl.java:214)
        at org.apache.activemq.ActiveMQSession.run(ActiveMQSession.java:751)
        at
org.apache.activemq.ra.ServerSessionImpl.run(ServerSessionImpl.java:163)
        at com.caucho.jca.WorkThread.run(WorkThread.java:99)
        at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
        at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
        at java.lang.Thread.run(Thread.java:595)

This is the activemq.xml I'm using:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://activemq.org/config/1.0">

	<broker persistent="false" useJmx="false">
		<transportConnectors>
			<transportConnector uri="vm://localhost" />
		</transportConnectors>

		<persistenceAdapter>
			<memoryPersistenceAdapter />
		</persistenceAdapter>
	</broker>

</beans>

Here's the broker and RA configuration from Spring:

	<bean id="jms.broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
		<property name="config">
			<value>classpath:activemq.xml</value>
		</property>

		<property name="start">
			<value>true</value>
		</property>
	</bean>

	<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>

-- 
Christopher G. Stach II

Re: rollbacks not working (4.0RC3)

Posted by Hiram Chirino <hi...@hiramchirino.com>.
No,

I think you will need a more recent snapshot than RC3

On 5/2/06, Christopher G. Stach II <cg...@ldsys.net> wrote:
> Christopher G. Stach II wrote:
> > Hiram Chirino wrote:
> >> Hi Christopher,
> >>
> >> I just committed a patch that should resolve the deadlock you posted.
> >> If you get a chance could confirm if it works for you?
> >>
> >> --
> >> Regards,
> >> Hiram
> >
> > Will do once the next snapshot is up.  Thanks!
> >
>
> Hiram:
>
> Is this change contained in RC3?  I haven't had time to test since I
> found that deadlock, but I think I can do it this week.
>
> --
> Christopher G. Stach II
>


--
Regards,
Hiram