-
Notifications
You must be signed in to change notification settings - Fork 2
Protocol
Sepehr Ghorbanpoor edited this page Jul 10, 2020
·
2 revisions
Currently row protocol is as simple as possible. The protocol itself is just a json text as websocket message body.
Request:
public class RequestDto {
private String id;
private String method;
private String address;
private JsonNode query;
private JsonNode body;
private Map<String, String> headers;
private Double version = 1.0;
}
Method is same as rest http methods. Address is the address after ws prefix (controller method address) to call. Query is query parameters (@Query). Body is message payload.
Response:
public class ResponseDto {
private String requestId;
private Object body;
private Map<String, String> headers;
private int status;
}
Status is almost same as http status of response. Body is response json payload.
If you look closely to request, you can see there is a field named id. This id is returned as requestId in response message so row client can know which request is the recieving response message for, so it will be able to handle callbacks.
Idioglossia Lab - ROW - Spring boot starter