vrajat commented on PR #12157:
URL: https://github.com/apache/pinot/pull/12157#issuecomment-1867294975
A simple script to show message expiration in kafka
Assume all the components are installed
- Kafka
- Kafka CLIs
- Faker
```
# Create a topic with retention of 1m
kafka_2.13-3.6.1/bin/kafka-topics.sh --bootstrap-server localhost:9092
--create --config retention.ms=60000 --topic cli_profiles
# Produce 5 rows
faker -r 5 profile | nl -w2 -v 10 -s':' |
./kafka_2.13-3.6.1/bin/kafka-console-producer.sh --bootstrap-server
localhost:9092 --property parse.key=true --property key.separator=":" --topic
cli_profile
# Example row:
1:{'job': 'Health service manager', 'company': 'Wall, Ballard and Anderson',
'ssn': '729-80-0324', 'residence': '42764 Porter Mountains\nStephenborough, NV
63641', 'current_location': (Decimal('56.096589'), Decimal('-156.143961')),
'blood_group': 'AB+', 'website': ['http://serrano.org/',
'https://huerta-kidd.com/'], 'username': 'martinezchristopher', 'name': 'Linda
Taylor', 'sex': 'F', 'address': '0509 Angela Road\nEast Sandraport, MP 39203',
'mail': '[email protected]', 'birthdate': datetime.date(1923, 9, 8)}
# Consume rows after a sleep of 90 seconds. None of these rows should be
available.
# kafka-console-consumer.sh is in wait state without printing any rows.
sleep 90
./kafka_2.13-3.6.1/bin/kafka-console-consumer.sh --bootstrap-server
localhost:9092 --property print.key=true --property key.separator=":" --topic
cli_profile
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]