Skip to content

Add messageID from string and from parts#526

Open
addisonj wants to merge 3 commits into
masterfrom
add_message_string
Open

Add messageID from string and from parts#526
addisonj wants to merge 3 commits into
masterfrom
add_message_string

Conversation

@addisonj
Copy link
Copy Markdown
Contributor

@addisonj addisonj commented May 22, 2021

If we want to deal with string message ids, we need methods for being
able to create them from either a string or a using the individual parts
of the message id.

This exposes some constructors for this as well as an equals method to make testing more straight forward (but I am not sure if we want to expose equals...)

This is primarily to match the java implementation, but if we don't want to add the string version, we should at least expose the method to make up a message id from the individual parts.

This commit adds tests for the needed new methods

addisonj added 2 commits May 22, 2021 15:29
If we want to deal with string message ids, we need methods for being
able to create them from either a string or a using the individual parts
of the message id.

This exposes some constructors for this.

Tests are needed for the string message parsing, but it is taking from
pulsarctl where it is well used
@addisonj addisonj requested a review from merlimat May 22, 2021 21:54
@addisonj addisonj changed the title Add message string Add messageID from string and from parts May 22, 2021
Comment thread pulsar/impl_message.go
}
return id.equal(rmsgid)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MessageID is an interface, Are we here trying to compare whether two interfaces are equal?

@wolfstudy wolfstudy added this to the 0.6.0 milestone May 24, 2021
Comment thread pulsar/message.go
// Serialize the message id into a sequence of bytes that can be stored somewhere else
Serialize() []byte
// String the message id represented as a string
String() string
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed the struct just needs to implement the Stringer interface
https://golang.org/pkg/fmt/#Stringer

Comment thread pulsar/message.go
// String the message id represented as a string
String() string
// Equals indicates to message IDs are equal
Equals(other MessageID) bool
Copy link
Copy Markdown
Contributor

@cckellogg cckellogg May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should add this either. We should avoid changing the interfaces since it's a breaking change and this can be accomplished with out doing that. We can add a util method like messageIDsEqual or MessageIDsEqual.

@wolfstudy
Copy link
Copy Markdown
Member

ping @addisonj any update for this?

@wolfstudy wolfstudy modified the milestones: 0.6.0, 0.7.0 Jul 21, 2021
@wolfstudy wolfstudy modified the milestones: 0.7.0, v0.8.0 Nov 1, 2021
@wolfstudy wolfstudy modified the milestones: v0.8.0, 0.9.0 Feb 16, 2022
@freeznet freeznet modified the milestones: v0.9.0, v0.10.0 Jul 4, 2022
@RobertIndie RobertIndie modified the milestones: v0.10.0, v0.11.0 Mar 27, 2023
@RobertIndie RobertIndie modified the milestones: v0.11.0, v0.12.0 Jul 4, 2023
@RobertIndie RobertIndie modified the milestones: v0.12.0, v0.13.0 Jan 10, 2024
@RobertIndie RobertIndie modified the milestones: v0.13.0, v0.14.0 Jul 15, 2024
@RobertIndie RobertIndie modified the milestones: v0.14.0, v0.15.0 Oct 8, 2024
@RobertIndie RobertIndie modified the milestones: v0.15.0, v0.16.0 May 15, 2025
@RobertIndie RobertIndie modified the milestones: v0.16.0, v0.17.0 Jul 29, 2025
@RobertIndie RobertIndie modified the milestones: v0.17.0, v0.18.0 Oct 23, 2025
@RobertIndie RobertIndie modified the milestones: v0.18.0, v0.19.0 Dec 1, 2025
@RobertIndie RobertIndie modified the milestones: v0.19.0, 0.20.0 Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants