diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2012-03-08 20:33:42 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2012-03-08 20:33:42 +0000 |
commit | 2491ee7318a4a4803348e1693739234679decd3b (patch) | |
tree | 6967998bfa219efcac6d2c0e49a2480dab1e373e | |
parent | d1d5bcd413cb40649cf9e74d033600c6928a934c (diff) | |
download | qpid-python-2491ee7318a4a4803348e1693739234679decd3b.tar.gz |
QPID-3884 Applying a patch by Kevin Conner.
The message-acks are now sent when we "end" the transaction as opposed
to sending them synchronously after each message.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1298564 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java | 10 | ||||
-rw-r--r-- | qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java b/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java index 0bf0b012ff..af9048f1f5 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/XAResourceImpl.java @@ -439,6 +439,16 @@ public class XAResourceImpl implements XAResource } } + /** + * Is this resource currently enlisted in a transaction? + * + * @return true if the resource is associated with a transaction, false otherwise. + */ + public boolean isEnlisted() + { + return (_xid != null) ; + } + //------------------------------------------------------------------------ // Private methods //------------------------------------------------------------------------ diff --git a/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java b/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java index 85623df8c0..6d5bf9ad67 100644 --- a/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java +++ b/qpid/java/client/src/main/java/org/apache/qpid/client/XASessionImpl.java @@ -18,6 +18,7 @@ package org.apache.qpid.client; import org.apache.qpid.client.message.MessageFactoryRegistry; +import org.apache.qpid.transport.RangeSet; import javax.jms.JMSException; import javax.jms.QueueSession; @@ -178,4 +179,17 @@ public class XASessionImpl extends AMQSession_0_10 implements XASession, XATopic { return (TopicSession) getSession(); } + + @Override + protected void acknowledgeImpl() + { + if (_xaResource.isEnlisted()) + { + acknowledgeMessage(Long.MAX_VALUE, true) ; + } + else + { + super.acknowledgeImpl() ; + } + } } |