|
@@ -121,7 +121,8 @@ public class GRPCController extends BaseController {
|
|
// 获取输出流
|
|
// 获取输出流
|
|
OutputStream outputStream = null;
|
|
OutputStream outputStream = null;
|
|
ManagedChannel channel = null;
|
|
ManagedChannel channel = null;
|
|
- response.setContentType("text/plain");
|
|
|
|
|
|
+// response.setContentType("text/plain");
|
|
|
|
+ response.setContentType("text/event-stream");
|
|
response.setCharacterEncoding("utf-8");
|
|
response.setCharacterEncoding("utf-8");
|
|
String dataJson = "";
|
|
String dataJson = "";
|
|
try {
|
|
try {
|
|
@@ -230,7 +231,8 @@ public class GRPCController extends BaseController {
|
|
// 获取输出流
|
|
// 获取输出流
|
|
OutputStream outputStream = null;
|
|
OutputStream outputStream = null;
|
|
ManagedChannel channel = null;
|
|
ManagedChannel channel = null;
|
|
- response.setContentType("text/plain");
|
|
|
|
|
|
+// response.setContentType("text/plain");
|
|
|
|
+ response.setContentType("text/event-stream");
|
|
response.setCharacterEncoding("utf-8");
|
|
response.setCharacterEncoding("utf-8");
|
|
try {
|
|
try {
|
|
channel = ManagedChannelBuilder.forAddress("10.0.0.24", 17070)
|
|
channel = ManagedChannelBuilder.forAddress("10.0.0.24", 17070)
|
|
@@ -263,10 +265,10 @@ public class GRPCController extends BaseController {
|
|
outputStream.write(responseStr.getBytes());
|
|
outputStream.write(responseStr.getBytes());
|
|
outputStream.flush();
|
|
outputStream.flush();
|
|
}
|
|
}
|
|
- //把SessionId返回给前端
|
|
|
|
- outputStream.write(sessionId.getBytes());
|
|
|
|
- outputStream.flush();
|
|
|
|
}
|
|
}
|
|
|
|
+ //把SessionId返回给前端
|
|
|
|
+ outputStream.write(sessionId.getBytes());
|
|
|
|
+ outputStream.flush();
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
throw new RuntimeException(e);
|
|
throw new RuntimeException(e);
|
|
} finally {
|
|
} finally {
|
|
@@ -401,7 +403,8 @@ public class GRPCController extends BaseController {
|
|
// 获取输出流
|
|
// 获取输出流
|
|
OutputStream outputStream = null;
|
|
OutputStream outputStream = null;
|
|
ManagedChannel channel = null;
|
|
ManagedChannel channel = null;
|
|
- response.setContentType("text/plain");
|
|
|
|
|
|
+// response.setContentType("text/plain");
|
|
|
|
+ response.setContentType("text/event-stream");
|
|
response.setCharacterEncoding("utf-8");
|
|
response.setCharacterEncoding("utf-8");
|
|
try {
|
|
try {
|
|
channel = ManagedChannelBuilder.forAddress("10.0.0.24", 17070)
|
|
channel = ManagedChannelBuilder.forAddress("10.0.0.24", 17070)
|