Skip to content
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

Cache inline synapse expressions #2287

Merged
merged 3 commits into from
Jan 20, 2025

Conversation

SanojPunchihewa
Copy link
Contributor

Purpose

Cache inline synapse expressions

Fixes: wso2/product-micro-integrator#3873
Fixes: wso2/product-micro-integrator#3878

if (expression == null) {
expression = new SynapseExpression(placeholder);
expressionCache.put(placeholder, expression);
}
String replacement = expression.stringValueOf(synCtx);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shall we calculate replacement values for the entire cached map at once. If we have the same expression used in several places, we don't have to evaluate again.

Copy link
Contributor Author

@SanojPunchihewa SanojPunchihewa Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with c699634 for the Payload factory. Logging the same expression multiple times in the same log is a rare cases. Hence skipped evaluated value caching in log mediator

@SanojPunchihewa SanojPunchihewa merged commit b3a3223 into wso2:master Jan 20, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants