Skip to content

Conversation

@johanandren
Copy link
Contributor

No description provided.

* Expected to be used "around" calls to plugin query method, will clear the correlation id from thread local
* to make sure there is no leak between logic executed on shared threads.
*/
def withCorrelationId[T](correlationId: String)(block: () => T): T = {
Copy link
Contributor

Choose a reason for hiding this comment

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

we'll probably only use this ourselves, with Scala, but shall we think about if it works for Java if we are making it public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. We could mark it as internal, but it will need to be binary compatible either way so I thought it can just as well be public API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added Java API


/**
* @return Expected to be called directly after receiving a query call, before starting any asynchronous tasks,
* returns and clears out the correlation id to make sure there is no leak between tasks. Further passing
Copy link
Contributor

@patriknw patriknw Dec 1, 2025

Choose a reason for hiding this comment

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

this method doesn't "clears out"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ups, leftover from previous iteration

Copy link
Contributor

@patriknw patriknw left a comment

Choose a reason for hiding this comment

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

LGTM

@patriknw patriknw added this to the 2.10.13 milestone Dec 1, 2025
@patriknw patriknw merged commit 266b2e6 into main Dec 1, 2025
10 checks passed
@patriknw patriknw deleted the wip-query-correlation-id branch December 1, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants