Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void delete(final byte[] keyBytes) throws Exception {
public void updateKvDataVersion() throws Exception {
kvDataVersion.nextVersion();
this.configRocksDBStorage.put(versionCF, KV_DATA_VERSION_KEY, KV_DATA_VERSION_KEY.length,
JSON.toJSONString(kvDataVersion).getBytes(StandardCharsets.UTF_8));
JSON.toJSONBytes(kvDataVersion, StandardCharsets.UTF_8));
}

public DataVersion getKvDataVersion() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private void appendAck(final AckMessageRequestHeader requestHeader, final BatchA

MessageExtBrokerInner msgInner = new MessageExtBrokerInner();
msgInner.setTopic(reviveTopic);
msgInner.setBody(JSON.toJSONString(ackMsg).getBytes(StandardCharsets.UTF_8));
msgInner.setBody(JSON.toJSONBytes(ackMsg, StandardCharsets.UTF_8));
msgInner.setQueueId(rqId);
if (ackMsg instanceof BatchAckMsg) {
msgInner.setTags(PopAckConstants.BATCH_ACK_TAG);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3195,7 +3195,7 @@ private RemotingCommand getUser(ChannelHandlerContext ctx,
response.setCode(ResponseCode.SUCCESS);
if (user != null) {
UserInfo userInfo = UserConverter.convertUser(user);
response.setBody(JSON.toJSONString(userInfo).getBytes(StandardCharsets.UTF_8));
response.setBody(JSON.toJSONBytes(userInfo, StandardCharsets.UTF_8));
}
})
.exceptionally(ex -> {
Expand All @@ -3218,7 +3218,7 @@ private RemotingCommand listUser(ChannelHandlerContext ctx,
response.setCode(ResponseCode.SUCCESS);
if (CollectionUtils.isNotEmpty(users)) {
List<UserInfo> userInfos = UserConverter.convertUsers(users);
response.setBody(JSON.toJSONString(userInfos).getBytes(StandardCharsets.UTF_8));
response.setBody(JSON.toJSONBytes(userInfos, StandardCharsets.UTF_8));
}
})
.exceptionally(ex -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ private CompletableFuture<Boolean> ackOrigin(final ChangeInvisibleTimeRequestHea
}

msgInner.setTopic(reviveTopic);
msgInner.setBody(JSON.toJSONString(ackMsg).getBytes(StandardCharsets.UTF_8));
msgInner.setBody(JSON.toJSONBytes(ackMsg, StandardCharsets.UTF_8));
msgInner.setQueueId(rqId);
msgInner.setTags(PopAckConstants.ACK_TAG);
msgInner.setBornTimestamp(System.currentTimeMillis());
Expand Down Expand Up @@ -326,7 +326,7 @@ private CompletableFuture<Boolean> appendCheckPointThenAckOrigin(
ck.setBrokerName(ExtraInfoUtil.getBrokerName(extraInfo));
ck.setSuspend(requestHeader.isSuspend());

msgInner.setBody(JSON.toJSONString(ck).getBytes(StandardCharsets.UTF_8));
msgInner.setBody(JSON.toJSONBytes(ck, StandardCharsets.UTF_8));
msgInner.setQueueId(reviveQid);
msgInner.setTags(PopAckConstants.CK_TAG);
msgInner.setBornTimestamp(System.currentTimeMillis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ public MessageExtBrokerInner buildCkMsg(final PopCheckPoint ck, final int revive
MessageExtBrokerInner msgInner = new MessageExtBrokerInner();

msgInner.setTopic(reviveTopic);
msgInner.setBody(JSON.toJSONString(ck).getBytes(StandardCharsets.UTF_8));
msgInner.setBody(JSON.toJSONBytes(ck, StandardCharsets.UTF_8));
msgInner.setQueueId(reviveQid);
msgInner.setTags(PopAckConstants.CK_TAG);
msgInner.setBornTimestamp(System.currentTimeMillis());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected void sendSystemMessage(Object data) {
try {
Message message = new Message(
targetTopic,
JSON.toJSONString(data).getBytes(StandardCharsets.UTF_8)
JSON.toJSONBytes(data, StandardCharsets.UTF_8)
);

AddressableMessageQueue messageQueue = this.topicRouteService.getAllMessageQueueView(ProxyContext.createForInner(this.getClass()), targetTopic)
Expand Down
Loading