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

Wish I could get the record key in async producer send callback #2452

Open
berrfred opened this issue Dec 16, 2024 · 1 comment
Open

Wish I could get the record key in async producer send callback #2452

berrfred opened this issue Dec 16, 2024 · 1 comment

Comments

@berrfred
Copy link

Hi, while producing records asynchronously, I'd like to be able to log the provided key together with topic/partition/offset upon successfull send ... if that makes sense to you.

#--- Print sent message partition and offset upon success
def on_send_success(record_metadata):
	#clog.log_(LOG_WARNING, f"sent|{record_metadata.topic}|{record_metadata.partition}|{record_metadata.offset}|{record_metadata.key}".encode('utf-8'))
	clog.log_(LOG_WARNING, f"sent|{record_metadata}".encode('utf-8'))

Today only the key size is available but not its value.

16/12/2024; 13:43:00.11; [W] $GDRK0 ; sent|RecordMetadata(topic='oamds-dr', partition=0, topic_partition=TopicPartition(topic='oamds-dr', partition=0), offset=131853, timestamp=1734352978359, log_start_offset=131838, checksum=None, serialized_key_size=44, serialized_value_size=55, serialized_header_size=66)

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

No branches or pull requests

2 participants
@berrfred and others