ARTEMIS-701 Set Accepted on AMQP discharge

This commit is contained in:
Martyn Taylor 2016-08-26 10:39:17 +01:00 committed by Clebert Suconic
parent b13d1b0d89
commit 930d814daf
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import io.netty.buffer.ByteBuf;
import io.netty.buffer.PooledByteBufAllocator;
import org.apache.qpid.proton.amqp.Binary;
import org.apache.qpid.proton.amqp.Symbol;
import org.apache.qpid.proton.amqp.messaging.Accepted;
import org.apache.qpid.proton.amqp.messaging.AmqpValue;
import org.apache.qpid.proton.amqp.messaging.Rejected;
import org.apache.qpid.proton.amqp.transaction.Declare;
@ -82,6 +83,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler {
if (discharge.getFail()) {
try {
sessionSPI.rollbackCurrentTX(true);
delivery.disposition(new Accepted());
}
catch (Exception e) {
throw ActiveMQAMQPProtocolMessageBundle.BUNDLE.errorRollingbackCoordinator(e.getMessage());
@ -90,6 +92,7 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler {
else {
try {
sessionSPI.commitCurrentTX();
delivery.disposition(new Accepted());
}
catch (ActiveMQAMQPException amqpE) {
throw amqpE;
@ -99,7 +102,6 @@ public class ProtonTransactionHandler implements ProtonDeliveryHandler {
}
}
}
}
catch (ActiveMQAMQPException amqpE) {
delivery.disposition(createRejected(amqpE.getAmqpError(), amqpE.getMessage()));