Skip to content

Got an error if message size exceeds 128k: the message is illegal, maybe msg body or properties length not matched. msg body length limit 128k, msg properties length limit 32k. #2282

@wn0112

Description

@wn0112

I'm using golang rocketmq-client as producer to send message.
https://github.com/apache/rocketmq-client-go
I tried to send message with SendSync() function.
If message size less than 128k, it works fine.

    // golang code
    msg := &primitive.Message{
        Topic: Cfg.Topic,
        Body:  []byte(message),
    }

    res, err := Producer.SendSync(context.Background(), msg)
    if err != nil {
        return err
    }

If the message size exceeds 128k, I got an error:

the message is illegal, maybe msg body or properties length not matched. msg body length limit 128k, msg properties length limit 32k.

Printing broker config with following command:

mqbroker.cmd -p
...
maxMessageSize=4194304
...

What's the problem please?

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