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

Event time not being set when batching is disabled in producer #1013

Closed
sanketkhotebsft opened this issue Apr 28, 2023 · 0 comments · Fixed by #1015
Closed

Event time not being set when batching is disabled in producer #1013

sanketkhotebsft opened this issue Apr 28, 2023 · 0 comments · Fixed by #1015
Assignees

Comments

@sanketkhotebsft
Copy link

sanketkhotebsft commented Apr 28, 2023

Expected behavior

The eventTime timestamp should be getting at the consumer side if its set at the time of producing the message

Actual behavior

after setting eventTime in the producer message, getting eventTime as 0 in the consumed message.

Steps to reproduce

Set
p.options.DisableBatching=true
and produce messages with eventTime:
msg := &pulsar.ProducerMessage{ EventTime: time.Now().UTC(), Payload: []byte(data) }

_, err = producer.Send(context.Background(), msg)

on the consumer side:
ts := msg.EventTime()

ts will get as a 1970-01-01 05:30:00 +0530 IST

in pulsar lib, we are adding eventTime to message metadata only when batching is enabled.

smm.EventTime = proto.Uint64(internal.TimestampMillis(msg.EventTime))

System configuration

Pulsar version: 0.10.0

@RobertIndie RobertIndie self-assigned this May 11, 2023
RobertIndie added a commit that referenced this issue May 17, 2023
Fixes #1013

### Motivation

The event time is not set when batching is disabled. The event time will be lost.
This is a regression bug in 0.10.0.

### Modifications

* Set the event time when sending single message
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 a pull request may close this issue.

2 participants