Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add original message timestamp to republished message headers #3933

Merged
merged 1 commit into from Apr 2, 2023

Conversation

amorey
Copy link
Contributor

@amorey amorey commented Mar 1, 2023

Adds original message timestamp to republished message as "Nats-Time-Stamp" header

  • Link to issue, e.g. Resolves #NNN
  • Documentation added (if applicable)
  • Tests added
  • Branch rebased on top of current main (git pull --rebase origin main)
  • Changes squashed to a single commit (described here)
  • Build is green in Travis CI
  • You have certified that the contribution is your original work and that you license the work to the project under the Apache 2 license

Resolves #

Changes proposed in this pull request:

  • Add original message timestamp to republished message as header "Nats-Time-Stamp"

@amorey amorey requested a review from a team as a code owner March 1, 2023 19:12
@amorey
Copy link
Contributor Author

amorey commented Mar 1, 2023

The test that failed seems unrelated to the code I changed and is passing locally. Any ideas on why it's failing and how I can fix it?

@derekcollison
Copy link
Member

I will kick it, that one is a flapper sometimes.

@amorey
Copy link
Contributor Author

amorey commented Apr 2, 2023

This is a small change to include the original timestamp in the message headers when a message gets republished. How can I submit this for inclusion in the next release?

@derekcollison
Copy link
Member

We will review before 2.10. Working on getting 2.9.16 out the door atm.

@@ -4056,21 +4056,23 @@ func (mset *stream) processJetStreamMsg(subject, reply string, hdr, msg []byte,

// Check for republish.
if republish {
tsStr := time.Unix(0, ts).UTC().Format(time.RFC3339Nano)
Copy link
Member

Choose a reason for hiding this comment

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

How expensive is this?

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@derekcollison derekcollison merged commit 299d9b2 into nats-io:dev Apr 2, 2023
1 check passed
@amorey
Copy link
Contributor Author

amorey commented Apr 3, 2023

Awesome!!! Thanks for taking a look!

@amorey amorey deleted the republish-timestamp branch April 3, 2023 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants