-
Notifications
You must be signed in to change notification settings - Fork 1.1k
INT-4457: Make log() in the end as reply-aware #2535
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9551b76
INT-4457: Make log() in the end as reply-aware
artembilan 6d28562
* Restore anonymous class in the MessageHistoryIntegrationTests:
artembilan 7667228
* Introduce `IntegrationFlowDefinition.logAndReply()` operator
artembilan ebd1241
* Fix logging message
artembilan 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
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
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.
We should probably add a comment here to explain why - I will do it when merging.
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.
Yeah... Makes sense.
This is really a cool trick since we did a
replyChannel
resolution against a reply message as fallback.So, this way the
HeaderEnricher
will be able to produce its reply to thatnullChannel
only if there is no areplyChannel
in the request message.However I'm starting to think that this should be something like
new NullChannel()
- definitely an internal matter and free from any management and metrics.WDYT?
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.
Hmmm... while writing the comment, it made me think that we have a problem here...
This logic will mask a "lost reply channel mistake".
Right now if we have
We'll get the infamous
no output-channel or replyChannel header available
error and quickly determine the problem.With this change, we'll no longer get the error and the gateway will hang or timeout.
I think this might cause us a bunch of Stack Overflow grief.
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.
To choices: close as "Works as Designed" or spend more time to think what could we do. For example to figure out some how how to intercept a
replyChannel
evaluated at runtime...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 had a couple of ideas:
replyChannel
header mid-flow..log().andReply()
, which would only be allowed on the last component.But WAD works for me too.
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 guess
.andReply()
would just be a synonym forbridge()
- but maybe semantically more pleasing.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.
Well, the flow might not start from the gateway, but simple channel.
That channel can be used for sending from the one-way scenario, as well as from the gateway one, on the other hand.
So, this our flow is not aware of the upstream in advance.
I believe we can restore code because it is stable and just document how to be in such a double case as long as the
replyChannel
propagation is supplied properly during the flow...Another option do not allow to register log/wire-tap in the end. As far as it is a channel interceptor there really should be an channel to apply to...
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.
How about just
logAndReply()
which is indeed a synonym for thelog().bridge()
and represent's no-op when is used in the middle?The double situation mentioned above is fully not related to the story and should be revised from the target application perspective.
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.
logAndReply()
sounds good - couldn't we detect it's used mid-flow by checking the previous component?