neo4j-eureka-plugin

Netflix Eureka Client Plugin for Neo4j

License

License

Categories

Categories

Neo4J Data Databases Eureka Container Microservices
GroupId

GroupId

com.brinkus.labs
ArtifactId

ArtifactId

neo4j-eureka-plugin
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

neo4j-eureka-plugin
Netflix Eureka Client Plugin for Neo4j
Project URL

Project URL

https://github.com/bbrinkus/neo4j-eureka-plugin
Source Code Management

Source Code Management

https://github.com/bbrinkus/neo4j-eureka-plugin

Download neo4j-eureka-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.brinkus.labs/neo4j-eureka-plugin/ -->
<dependency>
    <groupId>com.brinkus.labs</groupId>
    <artifactId>neo4j-eureka-plugin</artifactId>
    <version>1.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.brinkus.labs/neo4j-eureka-plugin/
implementation 'com.brinkus.labs:neo4j-eureka-plugin:1.1.0'
// https://jarcasting.com/artifacts/com.brinkus.labs/neo4j-eureka-plugin/
implementation ("com.brinkus.labs:neo4j-eureka-plugin:1.1.0")
'com.brinkus.labs:neo4j-eureka-plugin:jar:1.1.0'
<dependency org="com.brinkus.labs" name="neo4j-eureka-plugin" rev="1.1.0">
  <artifact name="neo4j-eureka-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.brinkus.labs', module='neo4j-eureka-plugin', version='1.1.0')
)
libraryDependencies += "com.brinkus.labs" % "neo4j-eureka-plugin" % "1.1.0"
[com.brinkus.labs/neo4j-eureka-plugin "1.1.0"]

Dependencies

compile (8)

Group / Artifact Type Version
com.esotericsoftware.yamlbeans : yamlbeans jar 1.09
com.fasterxml.jackson.core : jackson-databind jar 2.7.4
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.7.4
com.netflix.eureka : eureka-client jar 1.4.11
com.thoughtworks.xstream : xstream jar 1.4.8
org.apache.commons : commons-lang3 jar 3.3.2
org.apache.httpcomponents : httpclient jar 4.5.2
org.slf4j : slf4j-api jar 1.7.21

provided (1)

Group / Artifact Type Version
org.neo4j : server-api jar 3.1.0

test (5)

Group / Artifact Type Version
junit : junit jar 4.12
org.hamcrest : hamcrest-library jar 1.3
org.mockito : mockito-all jar 1.10.19
org.neo4j.test : neo4j-harness jar 3.1.0
org.slf4j : slf4j-simple jar 1.7.21

Project Modules

There are no modules declared in this project.

Neo4j Eureka Plugin

Versions

  • 1.1.0
    • Upgrade to labs-parent 1.2.0
    • Upgrade to neo4j 3.1.0
  • 1.0.1
    • Replace jackson to xstream
  • 1.0.0
    • Baseline

Neo4j Configuration

Neo4j (3.0+)

NEO4J_HOME/conf/neo4j.conf

dbms.security.auth_enabled=false
dbms.unmanaged_extension_classes=com.brinkus.labs.neo4j.eureka.unmanaged=/eureka

Neo4j (<3.0)

NEO4J_HOME/conf/neo4j-server.properties

dbms.security.auth_enabled=false
org.neo4j.server.thirdparty_jaxrs_classes=com.brinkus.labs.neo4j.eureka.unmanaged=/eureka

Plugin Configuration

The plugin configuration (YAML based): NEO4J_HOME/conf/neo4j-eureka.properties

# List of the service discovery servers host and port information
services:
  -
    host: discovery1.dev.brinkus.com
    port: 8761
  -
    host: discovery2.dev.brinkus.com
    port: 8762
# Registration information used in discovery service
registration:
  # Application's name
  name: neo4j
  # Virtual Internet Protocol address
  vipAddress: neo4j
  # Fully qualifed hostname of the instance
  hostname: neo4j.dev.brinkus.com
  # IP address of the instance
  ipAddress: 127.0.0.1
  # With AWS use the DNS resolvation name
  awsDnsHostname: true
  # The unsecured port
  port:
    port: 7474
    enabled: true
  # The secure port
  securePort:
    port: 7473
    enabled: false
  statusPageUrl: http://neo4j.dev.brinkus.com:7474/browser
  healthCheckUrl: http://neo4j.dev.brinkus.com:7474/eureka/health
  homePageUrl: http://neo4j.dev.brinkus.com:7474/

Eureka communication

  1. Get delta

    GET /eureka/apps/delta HTTP/1.1
    
  2. Register new application instance (STARTING state)

    POST /eureka/apps/NEO4J 
    {
        "instance":{
            "hostName":"neo4j.dev.brinkus.com",
            "app":"NEO4J",
            "ipAddr":"192.168.123.10",
            "status":"STARTING",
            "overriddenstatus":"UNKNOWN",
            "port":{
                "@enabled":"true",
                "$":"7474"
            },
            "securePort":{
                "@enabled":"false",
                "$":"7473"
            },
            "countryId":1,
            "dataCenterInfo":{
                "@class":"com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
                "name":"MyOwn"
            },
            "leaseInfo":{
                "renewalIntervalInSecs":30,
                "durationInSecs":90,
                "registrationTimestamp":0,
                "lastRenewalTimestamp":0,
                "evictionTimestamp":0,
                "serviceUpTimestamp":0
            },
            "metadata":{
                "@class":"java.util.Collections$EmptyMap"
            },
            "appGroupName":"UNKNOWN",
            "homePageUrl":"http://neo4j.dev.brinkus.com:7474/",
            "statusPageUrl":"http://neo4j.dev.brinkus.com:7474/",
            "healthCheckUrl":"http://neo4j.dev.brinkus.com:7474/",
            "vipAddress":"neo4j",
            "isCoordinatingDiscoveryServer":false,
            "lastUpdatedTimestamp":1460241157641,
            "lastDirtyTimestamp":1460241157641
        }
    }
    
  3. Update existing instance status

    1. Change status with a PUT
    PUT /eureka/apps/NEO4J/neo4j.dev.brinkus.com/status?value=UP
    
    1. Change status with a POST
    POST /eureka/apps/NEO4J 
    {
        "instance":{
            "hostName":"neo4j.dev.brinkus.com",
            "app":"NEO4J",
            "ipAddr":"192.168.123.10",
            "status":"UP",
            "overriddenstatus":"UNKNOWN",
            "port":{
                "@enabled":"true",
                "$":"7474"
            },
            "securePort":{
                "@enabled":"false",
                "$":"7473"
            },
            "countryId":1,
            "dataCenterInfo":{
                "@class":"com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo",
                "name":"MyOwn"
            },
            "leaseInfo":{
                "renewalIntervalInSecs":30,
                "durationInSecs":90,
                "registrationTimestamp":0,
                "lastRenewalTimestamp":0,
                "evictionTimestamp":0,
                "serviceUpTimestamp":0
            },
            "metadata":{
                "@class":"java.util.Collections$EmptyMap"
            },
            "appGroupName":"UNKNOWN",
            "homePageUrl":"http://neo4j.dev.brinkus.com:7474/",
            "statusPageUrl":"http://neo4j.dev.brinkus.com:7474/",
            "healthCheckUrl":"http://neo4j.dev.brinkus.com:7474/",
            "vipAddress":"neo4j",
            "isCoordinatingDiscoveryServer":false,
            "lastUpdatedTimestamp":1460241157641,
            "lastDirtyTimestamp":1460241198279
        }
    }
    
  4. Sending application heartbeat

    PUT /eureka/apps/NEO4J/neo4j.dev.brinkus.com
    
  5. De-register application instance

    DELETE /eureka/apps/NEO4J/neo4j.dev.brinkus.com
    

Versions

Version
1.1.0
1.0.1
1.0.0