Franz

Build Status Version License Platform Carthage compatible

Franz 是适用于 iOS 和 macOS 的 Apache Kafka 0.9.0 客户端。

用法

import Franz

let cluster = Cluster(brokers: [("localhost", 9092)], clientId: "FranzExample")

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

cluster.sendMessage("test", message: "Hello world!")

您可以在此处查看文档

当前的 Franz 版本应被视为 Beta 版。它不一定适用于生产代码。

该仓库包含 CocoaPods 和 Swift Package Manager 的示例项目。

安装

CocoaPods

将以下行添加到您的 Podfile

pod "Franz"

Swift Package Manager

将以下依赖项添加到您的 Package.swift

dependencies: [
    .package(url: "https://github.com/kellanburket/franz.git", from: "1.1.0"),
],
targets: [
    .target(name: "MyTarget", dependencies: ["Franz"])
]

Carthage

将以下依赖项添加到您的 Cartfile

github "kellanburket/franz" ~> 1.1.0

作者

Kellan Cummings

Luke Lau

许可证

Franz 在 MIT 许可证下可用。 更多信息请参见 LICENSE 文件。