Presenting pulsar-client-swift

Dear community,

for the past few weeks I've been developing an Apache Pulsar client library completely in Swift, based on SwiftNIO.

You can find the implementation here on Github and the documentation on the Swift Package index.

First, I tried to wrap the C++ client library but this was unsuccessful as the build is quite complicated with multiple dependencies, so I decided to start from scratch and implement it in Swift on top of swift-nio and swift-protobuf.
Due to the complexity of Pulsar the library is far from complete but the basics we can build upon are there. You can find the complete feature list here, but some highlights below:

Feature highlights

  • Basic consume and produce
  • Schema support for primitive schemas
  • Automatic reconnection
  • mTLS encryption and authentication
  • Sync and async send
  • Consumption in an async sequence
  • API makes full use of Swift concurrency

The library is compatible with Linux as well as macOS (I don't have a way to test Windows) and licensed under the Apache 2 license.

After tackling error handling and basic schema support in the last few releases, my next steps will be to check out advanced schema support as well as more configuration options, like alternative means of authentications.

Looking forward to hearing your feedback on the library and I hope it helps bringing more possibilities to Swift on Server!

5 Likes