public void closeMessageGroup()

in src/main/java/com/aws/amazonmq/blog/util/MsgProducer_FIFO_Close_Message_Group.java [130:143]


	public void closeMessageGroup(Session session, MessageProducer producer, String msgGroup, String msgPrefix, int msgId) {
		System.out.printf("Closing the active message group: '%s' at %d-th message. \n", msgGroup, msgId);
		TextMessage tMsg;
		String msgBody = msgPrefix + msgId;
		System.out.println("dummy message: " + msgBody);
		try {
			tMsg = session.createTextMessage(msgBody);
			tMsg.setStringProperty("JMSXGroupID", msgGroup);
			tMsg.setIntProperty("JMSXGroupSeq", -1);
			producer.send(tMsg);
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}