New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

com.adamthody:heroku-kafka-connection-helper

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.adamthody:heroku-kafka-connection-helper

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

  • 0.1.9
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

Heroku Kafka Connection Helper Build Status

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.8</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);

FAQs

Package last updated on 09 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc