transaction.setGateway(gateway);
gateway.addMessageListener(transaction);
SystemAcknowledgementHandler sys = new SystemAcknowledgementHandler();
MinaAcknowledgementListenerAndInterceptor acknowledgement = new MinaAcknowledgementListenerAndInterceptor();
acknowledgement.setHandler(sys);
acknowledgement.setGateway(gateway);
acknowledgement.setAckTimeoutMillis(200);
gateway.addMessageListener(acknowledgement);
gateway.addOutgoingMessageInterceptor(acknowledgement);
MinaReceiptListener receipt = new MinaReceiptListener();
receipt.setGateway(gateway);