diff --git a/docs/src/reference/docbook/claim-check.xml b/docs/src/reference/docbook/claim-check.xml index 9d9dad03ae..e9b96f5957 100644 --- a/docs/src/reference/docbook/claim-check.xml +++ b/docs/src/reference/docbook/claim-check.xml @@ -71,12 +71,15 @@ Claim Once - There are scenarios when a particular message must be claimed only once. Take the airplane luggage check-in/out process. - Checking-in your luggage on the departure and and then claiming it on the arrival is a classic example of such scenario. - Once the luggage was claimed it can no longer be claimed again without further check-in. To accommodate such cases we - introduced remove-message boolean attribute on claim-check-out transformer. This attribute is - set to false by default, however if set to true, the claimed Message will also be removed - from the MessageStore and can no longer be claimed again. + There are scenarios when a particular message must be claimed only once. As an analogy, consider the airplane luggage check-in/out process. + Checking-in your luggage on the departure and and then claiming it on the arrival is a classic example of such a scenario. + Once the luggage was claimed it can not be claimed again without first checking it back in. To accommodate such cases we + introduced a remove-message boolean attribute on the claim-check-out transformer. This attribute is + set to false by default. However if set to true, the claimed Message will also be removed + from the MessageStore so that it can no longer be claimed again. This is also something to consider in terms of storage space, + especially in the case of the in-memory Map-based SimpleMessageStore where failing to remove the Messages + could ultimately lead to an OutOfMemoryException. If you don't expect multiple claims to be made, it's + recommended that you set the remove-message attribute's value to false. retrievedMessage = this.messageStore.getMessage(id); Assert.notNull(retrievedMessage, "unable to locate Message for ID: " + id + " within MessageStore [" + this.messageStore + "]"); - if (this.removeMessage){ + if (this.removeMessage) { this.messageStore.removeMessage(id); - logger.debug("Message with claim-check '" + id + "' was removed from MessageStore"); + if (logger.isDebugEnabled()) { + logger.debug("Removed Message with claim-check '" + id + "' from the MessageStore."); + } } MessageBuilder responseBuilder = MessageBuilder.fromMessage(retrievedMessage); // headers on the 'current' message take precedence diff --git a/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd b/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd index afa4fcacd9..34e0b1eb16 100644 --- a/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd +++ b/spring-integration-core/src/main/resources/org/springframework/integration/config/xml/spring-integration-2.0.xsd @@ -1914,7 +1914,7 @@ endpoint itself is a Polling Consumer for a channel with a queue. If set to 'true' the Message will be removed from the MessageStore by - this transformer. Useful when Message can be 'claimed' only once. DFAULT is 'false' + this transformer. Useful when Message can be 'claimed' only once. DEFAULT is 'false'.