Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f7966b9b
authored
Sep 21, 2018
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
底层RPC序列化协议调整为hessian2;
parent
68c4e2cd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
10 deletions
doc/XXL-JOB官方文档.md
xxl-job-core/src/main/java/com/xxl/job/core/rpc/serialize/HessianSerializer.java
doc/XXL-JOB官方文档.md
View file @
f7966b9b
## 《分
布式任务调度平台XXL-JOB》
## 《分
布式任务调度平台XXL-JOB》
...
...
@@ -1268,9 +1268,10 @@ Tips: 历史版本(V1.3.x)目前已经Release至稳定版本, 进入维护阶段
-
29、GLUE脚本文件自动清理功能,及时清理过期脚本文件;
-
30、执行器注册方式切换优化,切换自动注册时主动同步在线机器,避免执行器为空的问题;
-
31、跨平台:除了提供Java、Python、PHP等十来种任务模式之外,新增提供基于HTTP的任务模式;
-
32、【迭代中】分片任务失败重试优化,仅重试当前失败的分片;
-
33、【迭代中】支持通过API服务操作任务信息;
-
34、【迭代中】底层RPC协议更换为hessian2;
-
32、底层RPC序列化协议调整为hessian2;
-
33、【迭代中】分片任务失败重试优化,仅重试当前失败的分片;
-
34、【迭代中】支持通过API服务操作任务信息;
### TODO LIST
...
...
xxl-job-core/src/main/java/com/xxl/job/core/rpc/serialize/HessianSerializer.java
View file @
f7966b9b
package
com
.
xxl
.
job
.
core
.
rpc
.
serialize
;
import
com.caucho.hessian.io.HessianInput
;
import
com.caucho.hessian.io.HessianOutput
;
import
com.caucho.hessian.io.Hessian
2
Input
;
import
com.caucho.hessian.io.Hessian
2
Output
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayOutputStream
;
...
...
@@ -15,22 +15,47 @@ public class HessianSerializer {
public
static
<
T
>
byte
[]
serialize
(
T
obj
){
ByteArrayOutputStream
os
=
new
ByteArrayOutputStream
();
Hessian
Output
ho
=
new
Hessian
Output
(
os
);
Hessian
2Output
ho
=
new
Hessian2
Output
(
os
);
try
{
ho
.
writeObject
(
obj
);
ho
.
flush
();
byte
[]
result
=
os
.
toByteArray
();
return
result
;
}
catch
(
IOException
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
}
finally
{
try
{
ho
.
close
();
}
catch
(
IOException
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
}
try
{
os
.
close
();
}
catch
(
IOException
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
}
}
return
os
.
toByteArray
();
}
public
static
<
T
>
Object
deserialize
(
byte
[]
bytes
,
Class
<
T
>
clazz
)
{
ByteArrayInputStream
is
=
new
ByteArrayInputStream
(
bytes
);
Hessian
Input
hi
=
new
Hessian
Input
(
is
);
Hessian
2Input
hi
=
new
Hessian2
Input
(
is
);
try
{
return
hi
.
readObject
();
Object
result
=
hi
.
readObject
();
return
result
;
}
catch
(
IOException
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
}
finally
{
try
{
hi
.
close
();
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
}
try
{
is
.
close
();
}
catch
(
IOException
e
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment