Heroku Kafka Connection Helper

A Java library to help configure Kafka client connection Properties from Heroku Kafka environment variables.

Лицензия

Лицензия

MIT
Категории

Категории

Heroku Контейнер PaaS Providers
Группа

Группа

com.adamthody
Идентификатор

Идентификатор

heroku-kafka-connection-helper
Последняя версия

Последняя версия

0.1.9
Дата

Дата

Тип

Тип

jar
Описание

Описание

Heroku Kafka Connection Helper
A Java library to help configure Kafka client connection Properties from Heroku Kafka environment variables.
Ссылка на сайт

Ссылка на сайт

https://github.com/thody/heroku-kafka-connection-helper
Система контроля версий

Система контроля версий

https://github.com/thody/heroku-kafka-connection-helper

Скачать heroku-kafka-connection-helper

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.adamthody/heroku-kafka-connection-helper/ -->
<dependency>
    <groupId>com.adamthody</groupId>
    <artifactId>heroku-kafka-connection-helper</artifactId>
    <version>0.1.9</version>
</dependency>
// https://jarcasting.com/artifacts/com.adamthody/heroku-kafka-connection-helper/
implementation 'com.adamthody:heroku-kafka-connection-helper:0.1.9'
// https://jarcasting.com/artifacts/com.adamthody/heroku-kafka-connection-helper/
implementation ("com.adamthody:heroku-kafka-connection-helper:0.1.9")
'com.adamthody:heroku-kafka-connection-helper:jar:0.1.9'
<dependency org="com.adamthody" name="heroku-kafka-connection-helper" rev="0.1.9">
  <artifact name="heroku-kafka-connection-helper" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.adamthody', module='heroku-kafka-connection-helper', version='0.1.9')
)
libraryDependencies += "com.adamthody" % "heroku-kafka-connection-helper" % "0.1.9"
[com.adamthody/heroku-kafka-connection-helper "0.1.9"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
com.github.jkutner : env-keystore jar 0.1.2

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
com.github.stefanbirkner : system-rules jar 1.16.0

Модули Проекта

Данный проект не имеет модулей.

Heroku Kafka Connection Helper Build Status Maven Central

A Java library to help configure Kafka client connection Properties from Heroku Kafka environment variables.

Usage

Include this library in your application as a Maven dependency:

<dependency>
  <groupId>com.adamthody</groupId>
  <artifactId>heroku-kafka-connection-helper</artifactId>
  <version>0.1.9</version>
</dependency>

Configuring a Client

Calling HerokuKafkaConnectionHelper.getConfigProperties() will return a Properties object that has the appropriate connection properties set, as per the environment variables available.

Based on the URL scheme of the KAFKA_URL environment variable, the properties will either be for a simple plaintext connection, or it will configure an SSL connection, including the KeyStore and TrustStore.

Heroku Kafka uses SSL by default, but by setting KAFKA_URL locally, you can also test against a local cluster with a plaintext connection for local development without having to modify code.

Properties properties = HerokuKafkaConnectionHelper.getConfigProperties();
... // Additional properties
KafkaConsumer<Integer, String> consumer = new KafkaConsumer<>(properties);

If you're using Spring's ProducerFactory or ConsumerFactory, you may prefer to get your connection configuration as a Map.

Map<String, Object> configMap = HerokuKafkaConnectionHelper.getConfigMap();
... // Additional properties
ProducerFactory<Integer, String> producer = new DefaultKafkaProducerFactory<>(configMap);

Версии библиотеки

Версия
0.1.9
0.1.8
0.1.7