Skip to content

[ISSUE #9396] Use fastjson2 in all modules#9397

Merged
RongtongJin merged 29 commits intoapache:developfrom
yx9o:dev-tofastjson2
Dec 4, 2025
Merged

[ISSUE #9396] Use fastjson2 in all modules#9397
RongtongJin merged 29 commits intoapache:developfrom
yx9o:dev-tofastjson2

Conversation

@yx9o
Copy link
Copy Markdown
Contributor

@yx9o yx9o commented May 10, 2025

Fixes #9396 .

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 10, 2025

Codecov Report

❌ Patch coverage is 58.06452% with 26 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.67%. Comparing base (1a3c922) to head (a7c4d8c).
⚠️ Report is 105 commits behind head on develop.

Files with missing lines Patch % Lines
...emoting/protocol/BitSetSerializerDeserializer.java 38.46% 5 Missing and 3 partials ⚠️
...mq/tools/command/export/ExportMetadataCommand.java 0.00% 3 Missing ⚠️
...mon/fastjson/GenericMapSuperclassDeserializer.java 85.71% 1 Missing and 1 partial ⚠️
...ache/rocketmq/common/utils/FastJsonSerializer.java 0.00% 2 Missing ⚠️
...tmq/remoting/protocol/heartbeat/HeartbeatData.java 0.00% 2 Missing ⚠️
...command/export/ExportMetadataInRocksDBCommand.java 0.00% 2 Missing ⚠️
...s/command/metadata/RocksDBConfigToJsonCommand.java 0.00% 2 Missing ⚠️
.../org/apache/rocketmq/store/timer/TimerMetrics.java 66.66% 1 Missing ⚠️
...mmand/broker/GetColdDataFlowCtrInfoSubCommand.java 0.00% 1 Missing ⚠️
...tmq/tools/command/export/ExportConfigsCommand.java 0.00% 1 Missing ⚠️
... and 2 more
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9397      +/-   ##
=============================================
+ Coverage      48.41%   49.67%   +1.25%     
- Complexity     12292    12695     +403     
=============================================
  Files           1315     1315              
  Lines          93918    93931      +13     
  Branches       12046    12049       +3     
=============================================
+ Hits           45475    46662    +1187     
+ Misses         42836    41556    -1280     
- Partials        5607     5713     +106     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fuyou001
Copy link
Copy Markdown
Contributor

1、Could you provide the performance benchmark data for the original Fastjson 1?
2、Could you provide compatibility test results with Fastjson 1, particularly when the object contains camel-case properties?

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented May 29, 2025

1、Could you provide the performance benchmark data for the original Fastjson 1? 2、Could you provide compatibility test results with Fastjson 1, particularly when the object contains camel-case properties?

Thank you for your review. The data for the two questions are as follows:
1.
image

image image image

Regarding question 2, I encountered the camel case problem of getCId during the replacement test. The solution is to move the @JSONField(name = "c") annotation from the attribute to the get/set method. All the replaced codes are covered by unit tests.

@hill007299 hill007299 requested a review from fuyou001 May 30, 2025 01:45
@fuyou001
Copy link
Copy Markdown
Contributor

fuyou001 commented Jun 8, 2025

Could you develop a tool to validate whether objects with camelCase properties are compatible with Fastjson 2, so we can check compatibility? @yx9o

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Jun 9, 2025

Could you develop a tool to validate whether objects with camelCase properties are compatible with Fastjson 2, so we can check compatibility? @yx9o

Let me understand. We need to develop a tool to test all objects in the project that have irregular camel case naming to ensure that fastjson1 and fastjson2 serialization are compatible, right?

@fuyou001
Copy link
Copy Markdown
Contributor

Could you develop a tool to validate whether objects with camelCase properties are compatible with Fastjson 2, so we can check compatibility? @yx9o

Let me understand. We need to develop a tool to test all objects in the project that have irregular camel case naming to ensure that fastjson1 and fastjson2 serialization are compatible, right?

Yes, but we should only validate classes involved in JSON serialization/deserialization.

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Jun 13, 2025

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

@fuyou001
Copy link
Copy Markdown
Contributor

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

When running RemotingSerializableCompatTest, I encountered failed classes. Here's the output for your review:
failed:class org.apache.rocketmq.remoting.protocol.body.RegisterBrokerBody
failed:class org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody
failed:class org.apache.rocketmq.remoting.protocol.route.TopicRouteData
failed:class org.apache.rocketmq.remoting.protocol.statictopic.TopicRemappingDetailWrapper
failed:class org.apache.rocketmq.remoting.protocol.body.SubscriptionGroupList
failed:class org.apache.rocketmq.remoting.protocol.body.GroupList
failed:class org.apache.rocketmq.remoting.protocol.body.ElectMasterResponseBody
failed:class org.apache.rocketmq.remoting.protocol.body.QueryAssignmentResponseBody
failed:class org.apache.rocketmq.remoting.protocol.body.BrokerMemberGroup
failed:class org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData
failed:class org.apache.rocketmq.remoting.protocol.body.CheckClientRequestBody
failed:class org.apache.rocketmq.remoting.protocol.body.GetBrokerMemberGroupResponseBody
failed:class org.apache.rocketmq.remoting.protocol.body.ClusterInfo
failed:class org.apache.rocketmq.remoting.protocol.body.QueryConsumeQueueResponseBody
failed:class org.apache.rocketmq.remoting.protocol.body.TopicList
failed:class org.apache.rocketmq.remoting.protocol.body.QuerySubscriptionResponseBody
failed:class org.apache.rocketmq.remoting.protocol.body.ConsumeByWho
failed:class org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo
failed:class org.apache.rocketmq.remoting.protocol.body.KVTable
failed:class org.apache.rocketmq.remoting.protocol.body.CreateTopicListRequestBody

@fuyou001
Copy link
Copy Markdown
Contributor

@yx9o Subclasses of ConfigManager must also be checked

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Jun 21, 2025

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

When running RemotingSerializableCompatTest, I encountered failed classes. Here's the output for your review: failed:class org.apache.rocketmq.remoting.protocol.body.RegisterBrokerBody failed:class org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.route.TopicRouteData failed:class org.apache.rocketmq.remoting.protocol.statictopic.TopicRemappingDetailWrapper failed:class org.apache.rocketmq.remoting.protocol.body.SubscriptionGroupList failed:class org.apache.rocketmq.remoting.protocol.body.GroupList failed:class org.apache.rocketmq.remoting.protocol.body.ElectMasterResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.QueryAssignmentResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.BrokerMemberGroup failed:class org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData failed:class org.apache.rocketmq.remoting.protocol.body.CheckClientRequestBody failed:class org.apache.rocketmq.remoting.protocol.body.GetBrokerMemberGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ClusterInfo failed:class org.apache.rocketmq.remoting.protocol.body.QueryConsumeQueueResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.TopicList failed:class org.apache.rocketmq.remoting.protocol.body.QuerySubscriptionResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ConsumeByWho failed:class org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo failed:class org.apache.rocketmq.remoting.protocol.body.KVTable failed:class org.apache.rocketmq.remoting.protocol.body.CreateTopicListRequestBody

Hello, I received your response. I have tested this class separately in the current branch and the develop branch. No errors occur. There is no "failed: xx" error output in the class itself. May I ask how you run this test?

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Jun 21, 2025

@yx9o Subclasses of ConfigManager must also be checked

ConfigManager's subclasses are in multiple different packages and cannot be tested uniformly using tool classes. I want to do fastjson1 serialization and fastjson2 deserialization compatibility verification in each subclass's Test. Is this OK?

@fuyou001
Copy link
Copy Markdown
Contributor

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

When running RemotingSerializableCompatTest, I encountered failed classes. Here's the output for your review: failed:class org.apache.rocketmq.remoting.protocol.body.RegisterBrokerBody failed:class org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.route.TopicRouteData failed:class org.apache.rocketmq.remoting.protocol.statictopic.TopicRemappingDetailWrapper failed:class org.apache.rocketmq.remoting.protocol.body.SubscriptionGroupList failed:class org.apache.rocketmq.remoting.protocol.body.GroupList failed:class org.apache.rocketmq.remoting.protocol.body.ElectMasterResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.QueryAssignmentResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.BrokerMemberGroup failed:class org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData failed:class org.apache.rocketmq.remoting.protocol.body.CheckClientRequestBody failed:class org.apache.rocketmq.remoting.protocol.body.GetBrokerMemberGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ClusterInfo failed:class org.apache.rocketmq.remoting.protocol.body.QueryConsumeQueueResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.TopicList failed:class org.apache.rocketmq.remoting.protocol.body.QuerySubscriptionResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ConsumeByWho failed:class org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo failed:class org.apache.rocketmq.remoting.protocol.body.KVTable failed:class org.apache.rocketmq.remoting.protocol.body.CreateTopicListRequestBody

Hello, I received your response. I have tested this class separately in the current branch and the develop branch. No errors occur. There is no "failed: xx" error output in the class itself. May I ask how you run this test?

RemotingSerializableCompatTest.testCompatibilityCheck method , I change :

image

            boolean isSuccess = checkCompatible(instance, clazz);
            if (!isSuccess) {
                System.out.println("failed:" + clazz);
            } 

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Jun 24, 2025

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

When running RemotingSerializableCompatTest, I encountered failed classes. Here's the output for your review: failed:class org.apache.rocketmq.remoting.protocol.body.RegisterBrokerBody failed:class org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.route.TopicRouteData failed:class org.apache.rocketmq.remoting.protocol.statictopic.TopicRemappingDetailWrapper failed:class org.apache.rocketmq.remoting.protocol.body.SubscriptionGroupList failed:class org.apache.rocketmq.remoting.protocol.body.GroupList failed:class org.apache.rocketmq.remoting.protocol.body.ElectMasterResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.QueryAssignmentResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.BrokerMemberGroup failed:class org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData failed:class org.apache.rocketmq.remoting.protocol.body.CheckClientRequestBody failed:class org.apache.rocketmq.remoting.protocol.body.GetBrokerMemberGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ClusterInfo failed:class org.apache.rocketmq.remoting.protocol.body.QueryConsumeQueueResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.TopicList failed:class org.apache.rocketmq.remoting.protocol.body.QuerySubscriptionResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ConsumeByWho failed:class org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo failed:class org.apache.rocketmq.remoting.protocol.body.KVTable failed:class org.apache.rocketmq.remoting.protocol.body.CreateTopicListRequestBody

Hello, I received your response. I have tested this class separately in the current branch and the develop branch. No errors occur. There is no "failed: xx" error output in the class itself. May I ask how you run this test?

RemotingSerializableCompatTest.testCompatibilityCheck method , I change :

image

            boolean isSuccess = checkCompatible(instance, clazz);
            if (!isSuccess) {
                System.out.println("failed:" + clazz);
            } 

I changed it like this and there was no error. Is there a difference in the environment? May I ask what branch, platform and jdk you are running on?

@fuyou001
Copy link
Copy Markdown
Contributor

fuyou001 commented Jun 30, 2025

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

When running RemotingSerializableCompatTest, I encountered failed classes. Here's the output for your review: failed:class org.apache.rocketmq.remoting.protocol.body.RegisterBrokerBody failed:class org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.route.TopicRouteData failed:class org.apache.rocketmq.remoting.protocol.statictopic.TopicRemappingDetailWrapper failed:class org.apache.rocketmq.remoting.protocol.body.SubscriptionGroupList failed:class org.apache.rocketmq.remoting.protocol.body.GroupList failed:class org.apache.rocketmq.remoting.protocol.body.ElectMasterResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.QueryAssignmentResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.BrokerMemberGroup failed:class org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData failed:class org.apache.rocketmq.remoting.protocol.body.CheckClientRequestBody failed:class org.apache.rocketmq.remoting.protocol.body.GetBrokerMemberGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ClusterInfo failed:class org.apache.rocketmq.remoting.protocol.body.QueryConsumeQueueResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.TopicList failed:class org.apache.rocketmq.remoting.protocol.body.QuerySubscriptionResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ConsumeByWho failed:class org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo failed:class org.apache.rocketmq.remoting.protocol.body.KVTable failed:class org.apache.rocketmq.remoting.protocol.body.CreateTopicListRequestBody

Hello, I received your response. I have tested this class separately in the current branch and the develop branch. No errors occur. There is no "failed: xx" error output in the class itself. May I ask how you run this test?

RemotingSerializableCompatTest.testCompatibilityCheck method , I change :
image

            boolean isSuccess = checkCompatible(instance, clazz);
            if (!isSuccess) {
                System.out.println("failed:" + clazz);
            } 

I changed it like this and there was no error. Is there a difference in the environment? May I ask what branch, platform and jdk you are running on?

This PR branch and uses JDK 11.

There are many issues concerning compatibility reported at https://github.com/alibaba/fastjson2/issues.

Be extremely cautious Upgrading to fastjson2 involves high risks

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Jun 30, 2025

Hi @fuyou001 , please help review again. According to your review, I added the following serialization compatibility test tool class: RemotingSerializableCompatTest. It mainly does the following:

  1. Construct objects with default parameters for all subclasses of RemotingSerializable
  2. Use fastjson1 to serialize the object obtained in the first step
  3. Use fastjson2 to deserialize the json string obtained in the second step
  4. Compare the object deserialized in the third step with the object constructed in the first step, and compare all attribute values. Their comparisons are all passed

When running RemotingSerializableCompatTest, I encountered failed classes. Here's the output for your review: failed:class org.apache.rocketmq.remoting.protocol.body.RegisterBrokerBody failed:class org.apache.rocketmq.remoting.protocol.header.GetConsumerListByGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.route.TopicRouteData failed:class org.apache.rocketmq.remoting.protocol.statictopic.TopicRemappingDetailWrapper failed:class org.apache.rocketmq.remoting.protocol.body.SubscriptionGroupList failed:class org.apache.rocketmq.remoting.protocol.body.GroupList failed:class org.apache.rocketmq.remoting.protocol.body.ElectMasterResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.QueryAssignmentResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.BrokerMemberGroup failed:class org.apache.rocketmq.remoting.protocol.heartbeat.HeartbeatData failed:class org.apache.rocketmq.remoting.protocol.body.CheckClientRequestBody failed:class org.apache.rocketmq.remoting.protocol.body.GetBrokerMemberGroupResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ClusterInfo failed:class org.apache.rocketmq.remoting.protocol.body.QueryConsumeQueueResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.TopicList failed:class org.apache.rocketmq.remoting.protocol.body.QuerySubscriptionResponseBody failed:class org.apache.rocketmq.remoting.protocol.body.ConsumeByWho failed:class org.apache.rocketmq.remoting.protocol.body.ConsumerRunningInfo failed:class org.apache.rocketmq.remoting.protocol.body.KVTable failed:class org.apache.rocketmq.remoting.protocol.body.CreateTopicListRequestBody

Hello, I received your response. I have tested this class separately in the current branch and the develop branch. No errors occur. There is no "failed: xx" error output in the class itself. May I ask how you run this test?

RemotingSerializableCompatTest.testCompatibilityCheck method , I change :
image

            boolean isSuccess = checkCompatible(instance, clazz);
            if (!isSuccess) {
                System.out.println("failed:" + clazz);
            } 

I changed it like this and there was no error. Is there a difference in the environment? May I ask what branch, platform and jdk you are running on?

This PR branch and uses JDK 11.

There are many issues concerning compatibility reported at https://github.com/alibaba/fastjson2/issues.

Be extremely cautious Upgrading to fastjson2 involves high risks

I have passed the debugging under jdk11, please help review it again, thank you.

@fuyou001
Copy link
Copy Markdown
Contributor

fuyou001 commented Jul 21, 2025

@yx9o The conflicts need to be handled
image

# Conflicts:
#	broker/src/main/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessor.java
#	broker/src/main/java/org/apache/rocketmq/broker/topic/TopicQueueMappingManager.java
#	broker/src/test/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessorTest.java
#	broker/src/test/java/org/apache/rocketmq/broker/subscription/SubscriptionGroupManagerTest.java
# Conflicts:
#	broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java
#	broker/src/main/java/org/apache/rocketmq/broker/transaction/TransactionMetrics.java
#	broker/src/test/java/org/apache/rocketmq/broker/processor/AdminBrokerProcessorTest.java
#	store/src/main/java/org/apache/rocketmq/store/timer/TimerMetrics.java
@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Sep 19, 2025

image image @yx9o Some problems were encountered during testing

Corrected, please review and verify again, thank you.

@guyinyou
Copy link
Copy Markdown
Contributor

@yx9o Some problems were encountered during testing yet

com.alibaba.fastjson2.JSONException: not support input EA==, offset 22, character ", line 1, column 23, fastjson-version 2.0.43 {"acks":[{"b":"EA==","c":"gid-72","it":60000,"pt":1758617828232,"q":0,"r":"0","rq":4,"so":245397,"t":"topic-a72"}],"brokerName":"rocketmq-broker-rmq-cn-htq4fg13h09-0"}
at com.alibaba.fastjson2.JSONReader.readBinary(JSONReader.java:756)
at com.alibaba.fastjson2.reader.ObjectReaderImplBitSet.readObject(ObjectReaderImplBitSet.java:44)
at com.alibaba.fastjson2.reader.ObjectReaderImplBitSet.readObject(ObjectReaderImplBitSet.java:11)
at com.alibaba.fastjson2.reader.ORG_20_18_BatchAck.readObject(Unknown Source)
at com.alibaba.fastjson2.reader.ORG_18_2_BatchAckMessageRequestBody.readObject(Unknown Source)
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1365)
at org.apache.rocketmq.remoting.protocol.RemotingSerializable.fromJson(RemotingSerializable.java:64)
at org.apache.rocketmq.remoting.protocol.RemotingSerializable.decode(RemotingSerializable.java:48)
at org.apache.rocketmq.broker.processor.AckMessageProcessor.processRequest(AckMessageProcessor.java:170)
at org.apache.rocketmq.broker.processor.AckMessageProcessor.processRequest(AckMessageProcessor.java:114)
at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.lambda$buildProcessRequestHandler$2(NettyRemotingAbstract.java:426)
at org.apache.rocketmq.remoting.netty.RequestTask.run(RequestTask.java:80)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:991)

# Conflicts:
#	broker/src/test/java/org/apache/rocketmq/broker/processor/ChangeInvisibleTimeProcessorTest.java
@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Sep 23, 2025

@yx9o Some problems were encountered during testing yet

com.alibaba.fastjson2.JSONException: not support input EA==, offset 22, character ", line 1, column 23, fastjson-version 2.0.43 {"acks":[{"b":"EA==","c":"gid-72","it":60000,"pt":1758617828232,"q":0,"r":"0","rq":4,"so":245397,"t":"topic-a72"}],"brokerName":"rocketmq-broker-rmq-cn-htq4fg13h09-0"} at com.alibaba.fastjson2.JSONReader.readBinary(JSONReader.java:756) at com.alibaba.fastjson2.reader.ObjectReaderImplBitSet.readObject(ObjectReaderImplBitSet.java:44) at com.alibaba.fastjson2.reader.ObjectReaderImplBitSet.readObject(ObjectReaderImplBitSet.java:11) at com.alibaba.fastjson2.reader.ORG_20_18_BatchAck.readObject(Unknown Source) at com.alibaba.fastjson2.reader.ORG_18_2_BatchAckMessageRequestBody.readObject(Unknown Source) at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1365) at org.apache.rocketmq.remoting.protocol.RemotingSerializable.fromJson(RemotingSerializable.java:64) at org.apache.rocketmq.remoting.protocol.RemotingSerializable.decode(RemotingSerializable.java:48) at org.apache.rocketmq.broker.processor.AckMessageProcessor.processRequest(AckMessageProcessor.java:170) at org.apache.rocketmq.broker.processor.AckMessageProcessor.processRequest(AckMessageProcessor.java:114) at org.apache.rocketmq.remoting.netty.NettyRemotingAbstract.lambda$buildProcessRequestHandler$2(NettyRemotingAbstract.java:426) at org.apache.rocketmq.remoting.netty.RequestTask.run(RequestTask.java:80) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:991)

The adjustment has been completed, please review again, thank you.

@guyinyou
Copy link
Copy Markdown
Contributor

希望增加bitset的兼容性测试,在目前的测试中该字段是null,可以增加模拟值去比较兼容性。
image

@yx9o
Copy link
Copy Markdown
Contributor Author

yx9o commented Oct 17, 2025

希望增加bitset的兼容性测试,在目前的测试中该字段是null,可以增加模拟值去比较兼容性。 image

Added, please review again, thank you.

Copy link
Copy Markdown
Contributor

@guyinyou guyinyou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

RongtongJin
RongtongJin previously approved these changes Oct 20, 2025
yx9o added 2 commits November 28, 2025 23:48
# Conflicts:
#	broker/src/main/java/org/apache/rocketmq/broker/config/v1/RocksDBConfigManager.java
#	broker/src/main/java/org/apache/rocketmq/broker/config/v1/RocksDBConsumerOffsetManager.java
#	broker/src/main/java/org/apache/rocketmq/broker/config/v1/RocksDBSubscriptionGroupManager.java
#	broker/src/main/java/org/apache/rocketmq/broker/config/v1/RocksDBTopicConfigManager.java
#	broker/src/main/java/org/apache/rocketmq/broker/processor/PopMessageProcessor.java
yx9o added 3 commits November 29, 2025 09:02
# Conflicts:
#	broker/src/main/java/org/apache/rocketmq/broker/pop/orderly/QueueLevelConsumerManager.java
#	broker/src/main/java/org/apache/rocketmq/broker/processor/AckMessageProcessor.java
#	broker/src/main/java/org/apache/rocketmq/broker/processor/ChangeInvisibleTimeProcessor.java
@RongtongJin RongtongJin merged commit d7e27d6 into apache:develop Dec 4, 2025
17 of 20 checks passed
@yx9o yx9o deleted the dev-tofastjson2 branch December 9, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Use fastjson2 in all modules

5 participants