Skip to content

alexnguyen2201/Test-Kafka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test-Kafka

Tạo topic "views" với 3 partition

Screen Shot 2022-05-19 at 21 08 31

producer.py

for number in range(100):
    data = {'number': number}
    data = json.dumps(data)

    p.produce(topic, data, callback=delivery_callback)
    p.poll(0)

    sys.stderr.write('%% Waiting for %d deliveries\n' % len(p))
    p.flush()

Bên trong producer.py vòng for lần lượt theo thứ tự từ 1-100 nhưng consumer lại nhận kết quả theo thứ tự khác

Screen Shot 2022-05-19 at 21 13 50

Phân bố message giữa các partition cũng không đồng đều

Screen Shot 2022-05-19 at 21 15 51

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages