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

Replaying requests without proto definitions #105

Closed
rithvikvibhu opened this issue Jun 12, 2020 · 4 comments · Fixed by #106
Closed

Replaying requests without proto definitions #105

rithvikvibhu opened this issue Jun 12, 2020 · 4 comments · Fixed by #106

Comments

@rithvikvibhu
Copy link

Is there any way to replay requests dumped by grpc-dump when the description files / definitions are not known?
Won't the raw_message field in the dump be enough to resend it (without modifications)?

@bradleyjkemp
Copy link
Owner

Hey @rithvikvibhu, yes this is exactly what grpc-replay does (or at least should do!)

You can see an example of this in the integration test:

replayErr := replay.Run(

The messages in https://github.com/bradleyjkemp/grpc-tools/blob/master/integration_test/test-dump.json are replayed even though there are no proto descriptors for some of them. If grpc-replay doesn't have a descriptor for a message it will just send the raw message directly.

Are you seeing issues with this feature?

@rithvikvibhu
Copy link
Author

rithvikvibhu commented Jun 14, 2020

Yeah, looks like it isn't working for me.
image

I can confirm the file contains 1 line of json object, with 2 messages in it.
1 client and 1 server origin. The problem is probably because the client origin message is empty (as expected), and there's no raw_message.

{
    "messages":[
        {
            "message_origin": "client",
            "message": {}
        },
        {
            "message_origin": "server",
            "raw_message": "Coc***",
            "message": { /*...*/ }
        }
    ]
}

@bradleyjkemp
Copy link
Owner

Ah I see the problem now! grpc-dump is omitting the "raw_message" field when it is empty but this is wrong: the empty string is a valid raw message (i.e. it's the empty message).

#106 should fix this issue

@rithvikvibhu
Copy link
Author

Hey, I tested this change, but it still says no resolver available when proto defs aren't given. But the dump now has raw_message: null when the message is {}.

Manually editing the dump from raw_message: null to raw_message: "" makes it work, though.

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 a pull request may close this issue.

2 participants