Skip to content

New consumer API

Pre-release
Pre-release
Compare
Choose a tag to compare
@lukel97 lukel97 released this 06 Oct 17:03
· 60 commits to master since this release

This release includes a new consumer API that makes it easier to start and stop listening to topics.
Here is an example using the new Consumer class:

let consumer = cluster.getConsumer(topics: ["foo", "bar"], groupId: "testGroup")
consumer.listen { message in
    let string = String(data: message.value, encoding: .utf8)!
    print(string)
}

The existing consumer classes, SimpleConsumer and HighLevelConsumer are still around but have been deprecated.