-
Notifications
You must be signed in to change notification settings - Fork 1.1k
GH-8704: Add global property for defaultTimeout
#8706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,16 +89,15 @@ public abstract class AbstractMessageProducingHandler extends AbstractMessageHan | |
|
||
private boolean noHeadersPropagation; | ||
|
||
{ | ||
this.messagingTemplate.setSendTimeout(IntegrationContextUtils.DEFAULT_TIMEOUT); | ||
} | ||
private boolean sendTimeoutSet; | ||
|
||
/** | ||
* Set the timeout for sending reply Messages. | ||
* @param sendTimeout The send timeout. | ||
*/ | ||
public void setSendTimeout(long sendTimeout) { | ||
this.messagingTemplate.setSendTimeout(sendTimeout); | ||
this.sendTimeoutSet = true; | ||
} | ||
|
||
@Override | ||
|
@@ -189,7 +188,7 @@ protected final void updateNotPropagatedHeaders(String[] headers, boolean merge) | |
@Override | ||
public Collection<String> getNotPropagatedHeaders() { | ||
return this.notPropagatedHeaders != null | ||
? Collections.unmodifiableSet(new HashSet<>(Arrays.asList(this.notPropagatedHeaders))) | ||
? Set.of(this.notPropagatedHeaders) | ||
: Collections.emptyList(); | ||
} | ||
|
||
|
@@ -217,6 +216,9 @@ protected void onInit() { | |
} | ||
this.messagingTemplate.setDestinationResolver(getChannelResolver()); | ||
setAsyncIfCan(); | ||
if (!this.sendTimeoutSet) { | ||
this.messagingTemplate.setSendTimeout(getIntegrationProperties().getEndpointsDefaultTimeout()); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto. |
||
} | ||
|
||
private void setAsyncIfCan() { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this intentional? Previously, the send timeout still defaulted to -1. Based on the docs, I assume yes. It makes sense to apply it, but I wonder if two properties are needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was like this in the ctor:
Yes, it was
-1
before6.1
.Not sure what you are asking about two props, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just wondering if we need a default send timeout as well as a default reply timeout property; since they are two different things; the send timeout is, for example, if a bounded
QueueChannel
is full whereas the reply timeout is for a request/reply.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean, but from end-user waiting perspective it looks the same, therefore I believe just a single default property is enough.
You can always override per endpoint and per property if there is a different requirements for send and receive.