mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Add original message timestamp to republished message headers (#3933)
Adds original message timestamp to republished message as "Nats-Time-Stamp" header - [ ] Link to issue, e.g. `Resolves #NNN` - [ ] Documentation added (if applicable) - [x] Tests added - [x] Branch rebased on top of current main (`git pull --rebase origin main`) - [x] Changes squashed to a single commit (described [here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html)) - [ ] Build is green in Travis CI - [x] You have certified that the contribution is your original work and that you license the work to the project under the [Apache 2 license](https://github.com/nats-io/nats-server/blob/main/LICENSE) Resolves # ### Changes proposed in this pull request: - Add original message timestamp to republished message as header "Nats-Time-Stamp" - -
This commit is contained in:
@@ -5651,6 +5651,12 @@ func TestJetStreamClusterStreamRepublish(t *testing.T) {
|
||||
seq, err := strconv.Atoi(m.Header.Get(JSSequence))
|
||||
require_NoError(t, err)
|
||||
require_True(t, seq == i)
|
||||
// Make sure timestamp is correct
|
||||
ts, err := time.Parse(time.RFC3339Nano, m.Header.Get(JSTimeStamp))
|
||||
require_NoError(t, err)
|
||||
origMsg, err := js.GetMsg("RP", uint64(seq))
|
||||
require_NoError(t, err)
|
||||
require_True(t, ts == origMsg.Time)
|
||||
// Make sure last sequence matches last seq we received on this subject.
|
||||
last, err := strconv.Atoi(m.Header.Get(JSLastSequence))
|
||||
require_NoError(t, err)
|
||||
|
||||
Reference in New Issue
Block a user