Skip to content

Why RepositoryMethodInvoker.doInvokeReactiveToSuspended strips coroutine continuation? #2532

Open
@ojh3636

Description

@ojh3636

[Version: spring-data-commons-2.4.13]

Hi, I have quesiton during digging the behavior of r2dbc, CoroutineCrudRepository.

First of all, What I want to do is logging query with some metadata that only can be retrieved from outer reactor or coroutine context (ex> ipath, eventId, spanId ..).

What I try first is

  1. Register ProxyConnectionFactory and register listener to log query.
  2. I wrote the code inside proxy listener that obtain "currentCoroutineContext[ReactorContext]" and use them when logging

But I found that "currentCoroutineContext[ReactorContext]" returns empty.

And I digging the repository behavior and I encounter below code.
image
Does the code in L168 means that all methods that are invoked in repository interface loose outer ractor or coroutine context?

Is there any way that can pass the outer coroutine or reactor context into repository method invokation?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions