hazelcast-heroku-discovery

Hazelcast Discovery Plugin for Heroku Private Spaces

License

License

MIT
Categories

Categories

Hazelcast Application Layer Libs Distributed Applications Heroku Container PaaS Providers
GroupId

GroupId

com.github.jkutner
ArtifactId

ArtifactId

hazelcast-heroku-discovery
Last Version

Last Version

3.7.2
Release Date

Release Date

Type

Type

jar
Description

Description

hazelcast-heroku-discovery
Hazelcast Discovery Plugin for Heroku Private Spaces
Project URL

Project URL

https://github.com/jkutner/hazelcast-heroku-discovery
Source Code Management

Source Code Management

https://github.com/jkutner/hazelcast-heroku-discovery

Download hazelcast-heroku-discovery

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.jkutner/hazelcast-heroku-discovery/ -->
<dependency>
    <groupId>com.github.jkutner</groupId>
    <artifactId>hazelcast-heroku-discovery</artifactId>
    <version>3.7.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.jkutner/hazelcast-heroku-discovery/
implementation 'com.github.jkutner:hazelcast-heroku-discovery:3.7.2'
// https://jarcasting.com/artifacts/com.github.jkutner/hazelcast-heroku-discovery/
implementation ("com.github.jkutner:hazelcast-heroku-discovery:3.7.2")
'com.github.jkutner:hazelcast-heroku-discovery:jar:3.7.2'
<dependency org="com.github.jkutner" name="hazelcast-heroku-discovery" rev="3.7.2">
  <artifact name="hazelcast-heroku-discovery" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.jkutner', module='hazelcast-heroku-discovery', version='3.7.2')
)
libraryDependencies += "com.github.jkutner" % "hazelcast-heroku-discovery" % "3.7.2"
[com.github.jkutner/hazelcast-heroku-discovery "3.7.2"]

Dependencies

compile (1)

Group / Artifact Type Version
com.hazelcast : hazelcast jar 3.7

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.7.21
com.github.stefanbirkner : system-rules jar 1.16.0

Project Modules

There are no modules declared in this project.

Hazelcast Heroku Discovery Build Status

This Hazelcast Discovery Plugin will lookup IP addresses of other members by resolving service names against the Heroku DNS Discovery in Heroku Private Spaces.

Usage

In Maven:

<dependency>
  <groupId>com.github.jkutner</groupId>
  <artifactId>hazelcast-heroku-discovery</artifactId>
  <version>3.7.0</version>
</dependency>

In Gradle:

dependencies {
    compile('com.github.jkutner:hazelcast-heroku-discovery:3.7.0')
}

A minimal hazelcast.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<hazelcast xsi:schemaLocation="http://www.hazelcast.com/schema/config hazelcast-config-3.7.xsd"
           xmlns="http://www.hazelcast.com/schema/config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <properties>
    <property name="hazelcast.discovery.enabled">true</property>
  </properties>
  <network>
    <join>
      <!-- deactivate normal discovery -->
      <multicast enabled="false"/>
      <tcp-ip enabled="false" />

      <!-- activate the Heroku DNS Discovery -->
      <discovery-strategies>
        <discovery-strategy
          enabled="true"
          class="com.github.jkutner.hazelcast.HerokuDiscoveryStrategy">
        </discovery-strategy>
      </discovery-strategies>
    </join>
  </network>
</hazelcast>

Hazelcast Discovery SPI

Hazelcast, since 3.6, offers a, so called, Discovery SPI to integrate external discovery mechanisms into the system. For more information please rely on the official documentation, available here.

Configuration

No configuration is required by default. The plugin will detect the service name from the $HEROKU_DNS_FORMATION_NAME environment variable set by Heroku.

If you want to configure the hazelcast.merge.first.run.delay.seconds, set the following in your hazelcast.xml:

<discovery-strategy
  enabled="true"
  class="com.github.jkutner.hazelcast.HerokuDiscoveryStrategy">
    <properties>
      <property name="mergeDelay">30</property>
    </properties>
</discovery-strategy>

If you want to configure the service names (i.e. the process types) that will be discovered, you can set a ; delimited list like this:

<discovery-strategy
  enabled="true"
  class="com.github.jkutner.hazelcast.HerokuDiscoveryStrategy">
    <properties>
      <property name="serviceNames">web;worker;job</property>
    </properties>
</discovery-strategy>

License

MIT

Versions

Version
3.7.2
3.7.1
3.7.0