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

Netty4 server无法记录或者回放 #427

Open
jinwik opened this issue Mar 20, 2024 · 0 comments
Open

Netty4 server无法记录或者回放 #427

jinwik opened this issue Mar 20, 2024 · 0 comments
Assignees
Labels
bug 🐞 Something isn't working good first issue 👍 Good for newcomers

Comments

@jinwik
Copy link

jinwik commented Mar 20, 2024

Steps to reproduce
deps: vertx-web 3.9.4

public class ServerVerticle extends AbstractVerticle {
    @Override
    public void start() {
        Router router = Router.router(vertx);
        router.get("/hello").handler(routingContext -> {
            routingContext.response().end(new JsonObject().put("message", "Hello, World!").encode());
        });
        vertx.createHttpServer()
            .requestHandler(router)
            .listen(9998);
    }

    public static void main(String[] args) {
        Vertx.vertx().deployVerticle(ServerVerticle.class.getName());
    }
}

Environment

Compiler: 1.8
arex-agent-java: 0.4.0

Additional context
简单修复:
删除掉RequestTracingHandler:channelReadComplete
在ResponseTracingHandler#invoke方法中 添加
if (ContextManager.needReplay()) {
MockUtils.replayBody(mocker);
} else if (ContextManager.needRecord()) {
MockUtils.recordMocker(mocker);
}
CaseEventDispatcher.onEvent(CaseEvent.ofExitEvent());

@jinwik jinwik added the bug 🐞 Something isn't working label Mar 20, 2024
@lucas-myx lucas-myx self-assigned this Mar 20, 2024
@mr3 mr3 added the good first issue 👍 Good for newcomers label Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working good first issue 👍 Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants