gripmock
gripmock copied to clipboard
Send and receive stream
Could you please provide an example how to setup mocking server if a client needs to send and receive multiple data?
For example having following proto:
syntax = "proto3";
package com.book;
message Book {
int64 isbn = 1;
string title = 2;
string author = 3;
}
message GetBookRequest {
int64 isbn = 1;
}
service BookService {
rpc GetBook (GetBookRequest) returns (Book) {}
}
It's needed mock server to operate with following data:
{
"isbn": 1,
"author": "Great Gatsby",
"author": "Fitzgerald"
},
{
"isbn": 1,
"author": "Tender Is the Night",
"author": "Fitzgerald"
},
{
"isbn": 2,
"author": "To Kill a Mockingbird",
"author": "Harper Lee"
}
Any updates?
I don't think what you need is stream function, rather you need to return repeated object.
@jekiapp current implementation of gripmock
seem to only supports the ping-pong model of streaming, i.e. client can send multiple requests as a stream and server will respond to each request with one response as part of a stream. Finally when the client ends the stream, the server will also end the stream. Need fully support of streaming, please.
I am also facing this issue. @jekiapp is there a solution already? Is there a workaround?
Thank you.
Any updates? @jekiapp @yosiaadijaya
Also looking for this feature. Any updates?
I am specifically looking for a way to simulate server streaming multiple replies (ideally separated by configurable time intervals). Does anyone know a way to do that? This example https://github.com/tokopedia/gripmock/blob/master/example/stream/stub/server2client-stream.json streams back only one reply; how to do two for example?
If this is not supported, please at least indicate it somewhere in either the README or the streaming example, making it easier for new users to evaluate gripmock.