Skip to content

[Bug] fastjson2 parse metricsExporterType in proxy config fail #9962

@yuz10

Description

@yuz10

Before Creating the Bug Report

  • I found a bug, not just asking a question, which should be created in GitHub Discussions.

  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.

  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.

Runtime platform environment

Ubuntu 24.04

RocketMQ version

5.4.0

JDK Version

1.8.0

Describe the Bug

error parsing metricsExporterType in proxy config

Steps to Reproduce

  1. set in conf/rmq-proxy.json:
{
  "rocketMQClusterName": "DefaultCluster",
  "metricsExporterType":"DISABLE"
}

2.start proxy:
bin/mqbroker --enable-proxy

What Did You Expect to See?

start success

What Did You See Instead?

start fail:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::arrayBaseOffset has been called by com.alibaba.fastjson2.util.JDKUtils (file:/root/rocketmq-all-5.4.0-bin-release/lib/fastjson2-2.0.43.jar)
WARNING: Please consider reporting this to the maintainers of class com.alibaba.fastjson2.util.JDKUtils
WARNING: sun.misc.Unsafe::arrayBaseOffset will be removed in a future release
com.alibaba.fastjson2.JSONException: parseInt error, value : DISABLE
        at com.alibaba.fastjson2.JSONReader.toInt32(JSONReader.java:3080)
        at com.alibaba.fastjson2.JSONReader.getInt32Value(JSONReader.java:894)
        at com.alibaba.fastjson2.JSONReaderUTF8.readInt32Value(JSONReaderUTF8.java:3955)
        at com.alibaba.fastjson2.reader.FieldReaderInt32ValueMethod.readFieldValue(FieldReaderInt32ValueMethod.java:19)
        at com.alibaba.fastjson2.reader.ObjectReaderBean.readObject(ObjectReaderBean.java:389)
        at com.alibaba.fastjson2.JSON.parseObject(JSON.java:726)
        at org.apache.rocketmq.proxy.config.Configuration.init(Configuration.java:44)
        at org.apache.rocketmq.proxy.config.ConfigurationManager.intConfig(ConfigurationManager.java:45)
        at org.apache.rocketmq.proxy.ProxyStartup.initConfiguration(ProxyStartup.java:125)
        at org.apache.rocketmq.proxy.ProxyStartup.main(ProxyStartup.java:71)

Additional Context

There was no problem in the early versions using fastjson1.
alibaba/fastjson2#2229 update to fastjson 2.0.52 will solve this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions