https://github.com/ovotech/ciris-aiven-kafka
Aiven Kafka support for Ciris
https://github.com/ovotech/ciris-aiven-kafka
company-kaluza kaluza-to-migrate
Last synced: over 1 year ago
JSON representation
Aiven Kafka support for Ciris
- Host: GitHub
- URL: https://github.com/ovotech/ciris-aiven-kafka
- Owner: ovotech
- License: mit
- Created: 2018-01-29T11:04:07.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-03-30T20:47:12.000Z (over 3 years ago)
- Last Synced: 2025-03-27T10:51:21.802Z (over 1 year ago)
- Topics: company-kaluza, kaluza-to-migrate
- Language: Scala
- Size: 136 KB
- Stars: 6
- Watchers: 24
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
## Ciris Aiven Kafka
[Aiven](https://aiven.io) Kafka support for [Ciris](https://cir.is).
### Getting Started
To get started with [sbt](https://www.scala-sbt.org), simply add the following lines to your `build.sbt` file.
```scala
resolvers += "Artifactory" at "https://kaluza.jfrog.io/artifactory/maven/"
libraryDependencies += "com.ovoenergy" %% "ciris-aiven-kafka" % "3.0.0"
```
The library is published for Scala 3.2.x, 2.13.x, and 2.12.x.
### Usage
`import ciris.aiven.kafka._` and use `aivenKafkaSetup` to set up the key and trust stores. Supplied credential strings are expected to be in PKCS 12 format.
```scala
import cats.effect.{ExitCode, IO, IOApp}
import cats.implicits._
import ciris._
import ciris.aiven.kafka._
object Main extends IOApp {
def run(args: List[String]): IO[ExitCode] =
aivenKafkaSetup(
clientPrivateKey = env("CLIENT_PRIVATE_KEY"),
clientCertificate = env("CLIENT_CERTIFICATE"),
serviceCertificate = env("SERVICE_CERTIFICATE")
).load[IO]
.as(ExitCode.Success)
}
```
If the configuration loading was successful, `aivenKafkaSetup` will return an `AivenKafkaSetup` with the key and trust store locations, and their passwords. Temporary files and passwords are used and the files are set to be deleted automatically on exit. The key store is of type PKCS12 and the trust store is of type JKS.
`AivenKafkaSetup` provides `properties: Map[String, String]` with suitable consumer properties.