Skip to content

[Issue 1399] add eventTime in reconsumeLaterWithCustomProperties func - #1400

Merged
RobertIndie merged 4 commits into
apache:masterfrom
YoungCoderboy:master
Jul 30, 2025
Merged

RobertIndie merged 4 commits into
apache:masterfrom
YoungCoderboy:master

Conversation

@YoungCoderboy

@YoungCoderboy YoungCoderboy commented Jul 25, 2025 •

Copy link
Copy Markdown
Contributor

Fixes #1399

Master Issue: #1399

Motivation

ReconsumeLater doesnot adds the eventTime in new rebuilded consumer Message before pushing to Retry or Dlq topic

Modifications

// line 639 (consumer_impl.go)
        consumerMsg := ConsumerMessage{
		Consumer: c,
		Message: &message{
			payLoad:    msg.Payload(),
			properties: props,
			msgID:      msgID,
			eventTime:  msg.EventTime(), //<-- eventTime is added
		},
	}
	if uint32(reconsumeTimes) > c.dlq.policy.MaxDeliveries {
		c.dlq.Chan() <- consumerMsg
	} else {
		c.rlq.Chan() <- RetryMessage{
			consumerMsg: consumerMsg,
			producerMsg: ProducerMessage{
				Payload:      msg.Payload(),
				Key:          msg.Key(),
				OrderingKey:  msg.OrderingKey(),
				Properties:   props,
				DeliverAfter: delay,
				EventTime:    msg.EventTime(), //<--eventTime is added
			},
		}
	}

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

go test -v ./pulsar -run TestRLQWithCustomPropertiesEventTime

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / GoDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@RobertIndie RobertIndie left a comment

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.

Thanks for the PR. Looks good to me. Could you add a test to cover it?

@YoungCoderboy

Copy link
Copy Markdown
Contributor Author

@RobertIndie I have added the test case as requested :)

@RobertIndie

Copy link
Copy Markdown
Member

There is an lint issue. Could you help fix it? https://github.com/apache/pulsar-client-go/actions/runs/16568065485/job/46911067127?pr=1400#step:5:28 @YoungCoderboy

@RobertIndie RobertIndie modified the milestones: v0.16.0, v0.17.0 Jul 29, 2025
@YoungCoderboy

Copy link
Copy Markdown
Contributor Author

@RobertIndie Made the Fix

@RobertIndie
RobertIndie merged commit 1f9e828 into apache:master Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing EventTime field in ReconsumeLaterWithCustomProperties

2 participants