IBM / sarama

Sarama is a Go library for Apache Kafka.
MIT License
11.57k stars 1.76k forks source link

Using MockBroker with v0.11+ #1665

Closed gm42 closed 1 year ago

gm42 commented 4 years ago
Versions
Sarama Kafka Go
v1.21.0 - 1.13.8
Configuration

What configuration values are you using for Sarama and Kafka?

    cfg := sarama.NewConfig()
    cfg.Producer.Return.Successes = true
        // this causes the the sync producer test to hang
    cfg.Version = sarama.V0_11_0_0
Problem Description

Forgive me the slightly old sarama version; I am having issues to create a test like TestSyncProducer that would also test for message headers functionality usage.

My test is a copy of TestSyncProducer with the above configuration added&used here: https://github.com/Shopify/sarama/blob/v1.21.0/sync_producer_test.go#L24

v0.11+ is necessary for the headers, however when specifying it the mock broker will not work (I assume because of the version requirement).

Is there a way to make the mock broker satisfy the requirement? Shall we add some test to sarama to cover this use-case?

adw1n commented 4 years ago

Newest Sarama version still suffers from the same problem.

ghost commented 3 years ago

Thank you for taking the time to raise this issue. However, it has not had any activity on it in the past 90 days and will be closed in 30 days if no updates occur. Please check if the master branch has already resolved the issue since it was raised. If you believe the issue is still valid and you would like input from the maintainers then please comment to ask for it to be reviewed.

dnwe commented 1 year ago

Unless I'm misunderstanding the description, this shouldn't be a problem on recent versions of Sarama. Please re-open if it is