//if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
if (!sequenceAcknowledgementsIter.hasNext())
sequenceID = sequenceAcknowledgement.getIdentifier().getIdentifier();
} else if (ackRequestedIter.hasNext()) {
rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.ACK_REQUEST);
AckRequested ackRequest = (AckRequested) ackRequestedIter.next();
//if there is only on sequenceAck, sequenceId will be set. Otherwise it will not be.
if (!ackRequestedIter.hasNext())
sequenceID = ackRequest.getIdentifier().getIdentifier();
} else if (closeSequence != null) {
rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE);
sequenceID = closeSequence.getIdentifier().getIdentifier();
} else if (closeSequenceResponse != null) {
rmMsgCtx.setMessageType(Sandesha2Constants.MessageTypes.CLOSE_SEQUENCE_RESPONSE);