Skip to content

Unable to correctly pass JSON object as inline message via CLI pulsar-client #7660

@devinbost

Description

@devinbost

To Reproduce
Steps to reproduce the behavior:

  1. Produce message via:
    bin/pulsar-client produce persistent://public/default/testInput -m '{ "test1" : "value1", "test2": "value2" }'
    Also try it like this:
    bin/pulsar-client produce persistent://public/default/testInput -m "{ 'test1' : 'value1', 'test2': 'value2' }"
    and like this:
    bin/pulsar-client produce persistent://public/default/testInput -m '"test1" : "value1", "test2": "value2"'

  2. Try deserializing the message. In none of the above cases will the object deserialize correctly.

Save the following text into a file named test.json:
{ "test1" : "value1", "test2": "value2" }
4. Produce message via:
bin/pulsar-client produce persistent://public/default/testInput -f test.json
5. Message deserializes correctly.

Expected behavior
Passing JSON via inline message should produce the same result as passing JSON via file.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions