Skip to content

WithKeys method append an unexpected separator to the last message key #1030

@gaofeihang

Description

@gaofeihang

BUG REPORT

  1. Please describe the issue you observed:

    • What did you do (The steps to reproduce)?

    • What did you expect to see?

    • What did you see instead?

Run the test below

func TestMessageKey(t *testing.T) {
	msg := &Message{}
	expected := "testKey"
	msg.WithKeys([]string{expected})
	actual := msg.GetKeys()
	if actual != expected {
		t.Fatalf("get message key error: expected is '%s', actual is '%s'", expected, actual)
	}
}

Expect msg.GetKeys() returns the same key as what msg.WithKeys() put.
msg.WithKeys() append an unexpected key separator ' ' to the message key instead.
The test outputs get message key error: expected is 'testKey', actual is 'testKey '

  1. Please tell us about your environment:

    • What is your OS?

    • What is your client version?

    • What is your RocketMQ version?

master code of rocketmq-client-go

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions