|
1 |
| -# 🚧WIP🚧: SwiftKafka |
| 1 | +# 🚧WIP🚧: Swift Kafka Client |
2 | 2 |
|
3 |
| -SwiftKafka is a Swift Package in development that provides a convenient way to communicate with [Apache Kafka](https://kafka.apache.org) servers. The main goal was to create an API that leverages [Swift's new concurrency features](https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html). Under the hood, this package uses the [`librdkafka`](https://github.com/confluentinc/librdkafka) C library. |
| 3 | +Swift Kafka Client is a Swift Package in development that provides a convenient way to communicate with [Apache Kafka](https://kafka.apache.org) servers. The main goal was to create an API that leverages [Swift's new concurrency features](https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html). Under the hood, this package uses the [`librdkafka`](https://github.com/confluentinc/librdkafka) C library. |
4 | 4 |
|
5 |
| -## Adding SwiftKafka as a Dependency |
| 5 | +## Adding Kafka as a Dependency |
6 | 6 |
|
7 |
| -To use the `SwiftKafka` library in a SwiftPM project, |
| 7 | +To use the `Kafka` library in a SwiftPM project, |
8 | 8 | add the following line to the dependencies in your `Package.swift` file:
|
9 | 9 |
|
10 | 10 | ```swift
|
11 |
| -.package(url: "https://github.com/swift-server/swift-kafka-gsoc", branch: "main") |
| 11 | +.package(url: "https://github.com/swift-server/swift-kafka-client", branch: "main") |
12 | 12 | ```
|
13 | 13 |
|
14 |
| -Include `"SwiftKafka"` as a dependency for your executable target: |
| 14 | +Include `"Kafka"` as a dependency for your executable target: |
15 | 15 |
|
16 | 16 | ```swift
|
17 | 17 | .target(name: "<target>", dependencies: [
|
18 |
| - .product(name: "SwiftKafka", package: "swift-kafka-gsoc"), |
| 18 | + .product(name: "Kafka", package: "swift-kafka-client"), |
19 | 19 | ]),
|
20 | 20 | ```
|
21 | 21 |
|
22 |
| -Finally, add `import SwiftKafka` to your source code. |
| 22 | +Finally, add `import Kafka` to your source code. |
23 | 23 |
|
24 | 24 | ## Usage
|
25 | 25 |
|
26 |
| -`SwiftKafka` should be used within a [`Swift Service Lifecycle`](https://github.com/swift-server/swift-service-lifecycle) |
| 26 | +`Kafka` should be used within a [`Swift Service Lifecycle`](https://github.com/swift-server/swift-service-lifecycle) |
27 | 27 | [`ServiceGroup`](https://swiftpackageindex.com/swift-server/swift-service-lifecycle/main/documentation/servicelifecycle/servicegroup) for proper startup and shutdown handling.
|
28 | 28 | Both the `KafkaProducer` and the `KafkaConsumer` implement the [`Service`](https://swiftpackageindex.com/swift-server/swift-service-lifecycle/main/documentation/servicelifecycle/service) protocol.
|
29 | 29 |
|
@@ -116,7 +116,7 @@ await withThrowingTaskGroup(of: Void.self) { group in
|
116 | 116 |
|
117 | 117 | #### Consumer Groups
|
118 | 118 |
|
119 |
| -SwiftKafka also allows users to subscribe to an array of topics as part of a consumer group. |
| 119 | +Kafka also allows users to subscribe to an array of topics as part of a consumer group. |
120 | 120 |
|
121 | 121 | ```swift
|
122 | 122 | let broker = KafkaConfiguration.Broker(host: "localhost", port: 9092)
|
|
0 commit comments