-
Notifications
You must be signed in to change notification settings - Fork 260
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
Return original attributes from webflux ClientRequest #1805
Conversation
dabdbd7
to
9c1be4d
Compare
9c1be4d
to
da61ecb
Compare
@whiskeysierra @lukasniemeier-zalando @kasmarian @msdousti |
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.
Thanks for opening this PR. I like the idea of ClientRequest
returning the request.attributes
as provided by the Spring Framework.
Please take a look at my comments on AllAttributesExtractor
.
logbook-api/src/main/java/org/zalando/logbook/attributes/AllAttributesExtractor.java
Outdated
Show resolved
Hide resolved
logbook-api/src/main/java/org/zalando/logbook/attributes/AllAttributesExtractor.java
Outdated
Show resolved
Hide resolved
logbook-api/src/main/java/org/zalando/logbook/attributes/AllAttributesExtractor.java
Outdated
Show resolved
Hide resolved
logbook-api/src/test/java/org/zalando/logbook/attributes/AllAttributesExtractorTest.java
Outdated
Show resolved
Hide resolved
@Dyuvarov Thanks a lot for your contribution! @kasmarian The PR is OK from my side :) |
👍 |
Thank you for the PR and for the review 👏 |
Description
Spring request has attributes. The current implementation of
ClientRequest
fromorg.zalando.logbook.spring.webflux
returns an empty attribute map whether there are attributes or not.This improvement gives access to the spring request attributes from
ClientRequest.getAttributes()
. Also added AllAttributesExtractor class to extract all attributes from original request.Motivation and Context
In a project my team is working on, we pass some data for spring
WebClient
request and response audit log messages via attributes. Now we have to use reflection to access them in the AttributeExtractor implementation becauseClientRequest.getAttributes()
returnsHttpAttributes.EMPTY
by defaultTypes of changes
Checklist: