Add new query so the same message found in pollMessageFromGroup is the one which gets deleted. See jira for more details: https://jira.springsource.org/browse/INT-3087 INT-3087 Polishing Use an atomic method in pollMessageFromGroup to pop the first message. Add test cases for pollMessageFromGroup and removeMessageFromGroup where the same message exists in multiple groups.