MessageContext terminateSeqMsg = terminateSeqRMMsg.getMessageContext();
// Processing the terminate message
// TODO Add terminate sequence message logic.
TerminateSequence terminateSequence = (TerminateSequence) terminateSeqRMMsg
.getMessagePart(Sandesha2Constants.MessageParts.TERMINATE_SEQ);
if (terminateSequence == null) {
String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.noTerminateSeqPart);
log.debug(message);
throw new SandeshaException(message);
}
String sequenceId = terminateSequence.getIdentifier().getIdentifier();
if (sequenceId == null || "".equals(sequenceId)) {
String message = SandeshaMessageHelper.getMessage(SandeshaMessageKeys.invalidSequenceID, null);
log.debug(message);
throw new SandeshaException(message);
}