Skip to content

Suggestion : provide executeBlocking mechanism #940

@hjianhao

Description

@hjianhao

In our project, we using reactive mode to gain high performance in high concurrency scenarios. But sometimes we had using a few legacy Blocking API.

So we need to using executor's executeBlocking to running these blocking code. but with this raw vert.x API, blocking code lost the InvocationContext. we need to using ugly wrapper to passing InvocationContext, traceId, etc , just like following :

public class TraceUtils {
public static Handler traceable (Handler fromHandler) {
String traceId = MDC.get(MDC.TRACE_ID_KEY);
return T -> {
MDC.put (MDC.TRACE_ID_KEY, traceId);
fromHandler.handle(T);
};
}
}

If servicecomb provide similar executingBlocking API, and passing the InvocationContext. it would be helpful. we can using InvocationContext the pass the context variable like traceId.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions