Skip to content

Navigation Menu

Sign in
Sign up

Logging shardId of the consumed records in KCL2.0 #1208

Closed Unanswered
Udhay707 asked this question in Q&A
Discussion options

public class KinesisRecordProcessor implements ShardRecordProcessor {

private String shardId;
@Override
public void initialize(InitializationInput initializationInput) {
	log.info("Starting to consume from shard: " + initializationInput.shardId());
	this.shardId = initializationInput.shardId();
}
@Override
public void processRecords(ProcessRecordsInput processRecordsInput) {
log.info("ShardId: {}", this.shardId);
}

Using the abovt approach, I am unable to get the actual shardId from which the record is processed, I have also tried with MDC, still no luck. Is there a way to accurately log the shardId ?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /