npm

Does your artifact manager get in the way? Join us on Oct. 8 at 10am PT, to discuss how npm can help.Sign up »

egg-eureka

1.0.2 • Public • Published

egg-eureka

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Polling fetch Eureka registry and get instance info

This plugin runs on agent worker

and will send registry data to app worker when updated

then you could use ctx.app.getInstancesByAppId(appId) to get instances by certain appId

Install

$ npm i egg-eureka --save

Usage

// {app_root}/config/plugin.js
exports.eureka = {
  enable: true,
  package: 'egg-eureka'
}

Configuration

// {app_root}/config/config.default.js
exports.eureka = {
  instance: {
    hostName: 'egg-eureka-app.local',
    // secureVipAddress: '',  
    // vipAddress: '',
    homePageUrl: '/', // just path, will automatically join with ip and port or hostname if given
    statusPageUrl: '/info', // just path, will automatically join with ip and port or hostname if given
    healthCheckUrl: '/health' // just path, will automatically join with ip and port or hostname if given
  },
  registry: {
    server: 'http://localhost:32768/eureka/v2/apps/', // if use eureka cluster, then pass an (Array<url>, or String split by ',') eg: ['eureka1host/path','eureka2/path] or 'eureka1host/path, eureka2host/path'
    heartbeatInterval: 5000,
    registryFetchInterval: 1000,
    //... other config follow eureka-js-client https://github.com/jquatier/eureka-js-client#advanced-configuration-options
  }
}

see config/config.default.js for more detail.

Example

Questions & Suggestions

Please open an issue here.

License

MIT

install

npm i egg-eureka

Downloadsweekly downloads

2

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability