Detalhes do pacote

bixby-sd

bixbyjs190.0.6

Service discovery components of the Bixby framework.

discovery, disco, sd, etcd

readme (leia-me)

bixby-sd

This suite of components provides service discovery functionality to applications using Bixby.js. Service discovery is the cornerstone of an effective microservices architecture. Each service advertises its capabilities, allowing other services to utilize that functionality when needed.

Install

$ npm install bixby-sd

Usage

To utilize service discovery components, register them with the IoC container. The standard namespace for these components is sd.

IoC.use('sd', require('bixby-sd'));

Table of Contents

Components

Registry

exports['@require'] = [ 'sd/registry' ];

The registry component provides a service registry where a service can announce its capabilities as well as resolve other services. The interface supported by this component is defined by Registry.

Support for service registries is pluggable, allowing engineering teams to choose the registry that best meets their requirements. The type of registry to use is determined via configuration settings.

ZooKeeper

Apache ZooKeeper can be used as a service registry by specifying a zk:// URL in the [sd] section. The Registry instance is constructed from the sd-zookeeper module.

[sd]
url = "zk://127.0.0.1:2181"
etcd

etcd can be used as a service registry by specifying an etcd:// URL in the [sd] section. The Registry instance is constructed from the sd-etcd module.

[sd]
url = "etcd://127.0.0.1:4001"

When using etcd, the following settings are also supported:

  • {integer} [ttl] - TTL of any announced services, auto updated by heartbeats

Tests

$ make test

License

The MIT License

Copyright (c) 2014 NodePrime, Inc. [http://www.nodeprime.com/](http://www.nodeprime.com/)
Copyright (c) 2014 Jared Hanson [http://www.jaredhanson.net/](http://www.jaredhanson.net/)

changelog (log de mudanças)

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

[0.0.6] - 2024-08-30

Changed

  • LocalhostResolver now works solely off of configuration, no longer depends on a component implementing the http://i.bixbyjs.org/ns/ServicesList interface or associated @service and @port annotations.

Removed

  • services component which implemented http://i.bixbyjs.org/ns/ServicesList. Equivalent functionality has moved to bixby-ns, but uses configuration files rather than @service and @port annotations.

[0.0.5] - 2024-08-26

Changed

  • Switch always resolves within localhost domain. A future version will introduce support for search domains.

0.0.4 - 2024-08-26

Added

  • EnvironResolver supports "generic" environment variables (such as DATABASE_URL) when resolving URIs.

0.0.3 - 2024-08-26

Fixed

  • Remove unused @require of 'http://i.bixbyjs.org/services' from resolver.

0.0.2 - 2024-08-26

Changed

  • EnvironResolver now works solely off of environment variables, no longer depends on a component implementing the http://i.bixbyjs.org/ns/ServicesList interface or associated @service and @env annotations.

Removed

  • HostsResolver, which utilized components that implement the defunct http://i.bixbyjs.org/IService interface. The corresponding registry which implements http://i.bixbyjs.org/services is slated to be removed from bixby-common after version 0.2.1.

0.0.1 - 2024-05-02

  • Initial release.