Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

INT-2920 Fix two hits to MessageStore #736

Closed
wants to merge 3 commits into from

3 participants

@nickspacek

Reduce ClaimCheckOutTransformer's hits to the MessageStore.

JIRA: https://jira.springsource.org/browse/INT-2920

@nickspacek nickspacek INT-2920 Fix two hits to MessageStore
Reduce ClaimCheckOutTransformer's hits to the MessageStore.

JIRA: https://jira.springsource.org/browse/INT-2920
8d173d5
@markfisher markfisher was assigned
@markfisher
Owner

Thanks for issuing the pull request! One "minor" detail... it doesn't compile ;)

spring-integration/spring-integration-core/src/main/java/org/springframework/integration/transformer/ClaimCheckOutTransformer.java:70: ';' expected
                + " within MessageStore [" + this.messageStore + "]")
                                                                     ^
1 error
:spring-integration-core:compileJava FAILED

I can fix that, but it would be great if you re-issue. Also, if you don't mind updating the copyright range to 2013, and add an @ author tag.

For future reference (we do hope you issue more PRs!), the info here can be helpful for walking thru the steps (like running the build and tests pre-push, etc): https://github.com/SpringSource/spring-integration/wiki/Contributor-Guidelines

@nickspacek

That's embarrassing, I will admit I skipped the build and test, yikes. I will make the changes!

@nickspacek

I don't think this is related to my fix, but when I run the tests I get 1 failure:

org.springframework.integration.core.AsyncMessagingTemplateTests > executionException
FAILED
    java.lang.Exception
        Caused by: java.util.concurrent.TimeoutException at AsyncMessagingTemplateTests.java:409
@garyrussell
Owner

LGTM; merging.

@garyrussell garyrussell closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 6, 2013
  1. @nickspacek

    INT-2920 Fix two hits to MessageStore

    nickspacek authored
    Reduce ClaimCheckOutTransformer's hits to the MessageStore.
    
    JIRA: https://jira.springsource.org/browse/INT-2920
  2. @nickspacek
  3. @nickspacek

    Fixed missing semi-colon

    nickspacek authored
This page is out of date. Refresh to see the latest.
View
14 ...e/src/main/java/org/springframework/integration/transformer/ClaimCheckOutTransformer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 the original author or authors.
+ * Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,7 @@
*
* @author Mark Fisher
* @author Oleg Zhurakousky
+ * @author Nick Spacek
* @since 2.0
*/
public class ClaimCheckOutTransformer extends AbstractTransformer {
@@ -56,15 +57,18 @@ protected Object doTransform(Message<?> message) throws Exception {
Assert.notNull(message, "message must not be null");
Assert.isTrue(message.getPayload() instanceof UUID, "payload must be a UUID");
UUID id = (UUID) message.getPayload();
- Message<?> retrievedMessage = this.messageStore.getMessage(id);
- Assert.notNull(retrievedMessage, "unable to locate Message for ID: " + id
- + " within MessageStore [" + this.messageStore + "]");
+ Message<?> retrievedMessage;
if (this.removeMessage) {
- this.messageStore.removeMessage(id);
+ retrievedMessage = this.messageStore.removeMessage(id);
if (logger.isDebugEnabled()) {
logger.debug("Removed Message with claim-check '" + id + "' from the MessageStore.");
}
}
+ else {
+ retrievedMessage = this.messageStore.getMessage(id);
+ }
+ Assert.notNull(retrievedMessage, "unable to locate Message for ID: " + id
+ + " within MessageStore [" + this.messageStore + "]");
MessageBuilder<?> responseBuilder = MessageBuilder.fromMessage(retrievedMessage);
// headers on the 'current' message take precedence
responseBuilder.copyHeaders(message.getHeaders());
Something went wrong with that request. Please try again.