use of io.vertx.tp.ipc.eon.IpcEnvelop in project vertx-zero by silentbalanceyh.
the class DataEncap method consume.
/**
* Middle process
*
* @param request
* @param type
*/
public static IpcData consume(final IpcRequest request, final IpcType type) {
final IpcData ipcData = new IpcData();
final IpcEnvelop envelop = request.getEnvelop();
final String data = envelop.getBody();
final JsonObject json = new JsonObject(data);
// Address convert
if (json.containsKey("address")) {
ipcData.setAddress(json.getString("address"));
json.remove("address");
}
ipcData.setData(Buffer.buffer(data));
ipcData.setType(type);
return ipcData;
}
Aggregations