-
Notifications
You must be signed in to change notification settings - Fork 264
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
Optimize body filters #493
Comments
So why the String part of replaceJsonStringProperty, surely replacing other property types or even array and objects would be desirable? We're using a filter just like that (which parses and writes) now, not just for removing values we don't want to log, but also to reduce the size of the log statement (there is a max size). |
Replacing whole structures requires to properly parse the string. String properties can be detected and replaced quite easily and quickly using regular expressions. It's a simple trade-off between power and speed. Replacing string properties was solving the majority of cases without introducing a full second parsing of the body. |
Detailed Description
Registering multiple body filters of the same type, e.g.
replaceJsonStringProperty
works but is inefficient because they run sequentially. Optimizing those filters by merging them into one would be useful.Context
Improve performance by reducing raw body processing to the bare minimum.
Possible Implementation
MergeableBodyFilter
(extendsBodyFilter
)replaceJsonStringProperty
a proper class, implementingMergeableBodyFilter
instanceof ReplaceJsonStringProperty
and create a new instance using properties from this and the other filterBodyFilter.merge(..)
The text was updated successfully, but these errors were encountered: