Skip to content

use telnet debug, but perform not the same as rpc ,due to JSON.json() #6523

@liangwenzhang

Description

@liangwenzhang

when I debug dubbo use telnet ,it perform not the same as the rpc result. In the result json, some properties are missing.....

telnet use com.alibaba.dubbo.common.json.JSON#json(java.lang.Object) to serialize result to json.
there are two problems use this method to convert to json.

  1. obj need to have getter and setter.
    com.alibaba.dubbo.common.bytecode.Wrapper#makeWrapper
    property with only getter will discard.

  2. if setter return self, like use lombok accessor chain. SETTER_METHOD_DESC_PATTERN does not match the setter method.

public static final Pattern SETTER_METHOD_DESC_PATTERN = Pattern.compile("set([A-Z][_a-zA-Z0-9]*)\((" + DESC_REGEX + ")\)V");

I wonder if this could be improved or if there are some other ways to debug the dubbo?

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