Skip to content

Commit

Permalink
changelog typo
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Sep 11, 2017
1 parent f6ddf4b commit 6b46fea
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@
# Breaking changes

## Protocol changed [#86](https://github.com/ice-services/moleculer/issues/86)
The Moleculer transportation protocol is changed. It's mean, **the new (>= v0.11) versions can't communicate with the old (<= c0.10.x) versions.**
The Moleculer transportation protocol is changed. It means, **the new (>= v0.11) versions can't communicate with the old (<= v0.10.x) versions.**
You can find more information about changes in [#86](https://github.com/ice-services/moleculer/issues/86) issue.

## Balanced events
The whole event handling is rewritten. From now Moleculer supports [event driven architecture](http://microservices.io/patterns/data/event-driven-architecture.html). It means the event emits is balanced like action calls.
The whole event handling is rewritten. From now Moleculer supports [event driven architecture](http://microservices.io/patterns/data/event-driven-architecture.html). It means the event emits are balanced like action calls.

For example, you have 2 main services: `users` & `payments`. Both subscribe to the `user.created` event. You start 3 instances from `users` service and 2 instances from `payments` service. If you emit the event with `broker.emit('user.created')`, broker will grouping & balancing the event, so only one `users` and one `payments` service will receive the event.
You can also send broadcast events with the `broker.broadcast('user.created`) command. In this way every service instances on every nodes will receive the event.
The `broker.broadcastLocal('user.created')` command only send events to the local services.
The `broker.broadcastLocal('user.created')` command send events only to the local services.

## Renamed & new internal events
Every internal event names start with '$'. This event is not transferred to remote nodes.
Every internal event names start with '$'. These events are not transferred to remote nodes.

**Renamed event:**
- `node.connected` -> `$node.connected`.
**Renamed events:**
- `node.connected` -> `$node.connected`
- `node.updated` -> `$node.updated`
- `node.disconnected` -> `$node.disconnected`
- `services.changed` -> `$services.changed`. It is called if local or remote service list changed.
Expand All @@ -29,7 +29,7 @@ Every internal event names start with '$'. This event is not transferred to remo
**New events:**
- global circuit breaker events for metrics: `metrics.circuit-breaker.closed`, `metrics.circuit-breaker.opened`, `metrics.circuit-breaker.half-opened`

## Built-in load balancer is switchable.
## Switchable built-in load balancer
The built-in Moleculer load balancer is switchable. You can turn off it, if you use transporter what has internal balancer (like AMQP).

```js
Expand All @@ -43,40 +43,40 @@ const broker = new ServiceBroker({
> Please note! If built-in balancer is disabled, every calls & emits (includes locals too) are transferred via transporter.
## Removed broker methods
Some internal broker methods is removed or renamed.
Some internal broker methods are removed or renamed.
- `broker.bus` is removed. Use `events` in service schema instead.
- `broker.on` is removed. Use `events` in service schema instead.
- `broker.once` is removed. Use `events` in service schema instead.
- `broker.off` is removed. Use `events` in service schema instead.
- `broker.getService` is renamed to `broker.getLocalService`
- `broker.hasService` is removed.
- `broker.hasAction` is removed.
- `broker.getAction` is deprecated.
- `broker.isActionAvailable` is removed.


## Changed local service responses
- changed returned structure of `$node.list`, `$node.services`, `$node.actions`, `$node.health`
- new internal action `$node.events`

# New
Internal action (`$node.list`, `$node.services`, `$node.actions`, `$node.health`) responses are changed. New internal action (`$node.events`) to list event subscriptiion is added.

## Broker option changes
- `heartbeatInterval` default value is changed from `10` to `5`.
- `heartbeatTimeout` default value is changed from `30` to `15`.
- `circuitBreaker.maxFailures` default value is changed from `5` to `3`.
- `logFormatter` accepts string. The `simple` is a new formatter to show only log level & log messages.
- `logFormatter` accepts string. The `simple` value is a new formatter to show only log level & log messages.

# New

## Ping command
Implemented a new PING & PONG feature. You can ping other nodes to measure the network latency and system time differences.

```js
broker.createService({
name: "test",
events: {
"$node.pong"({ nodeID, elapsedTime, timeDiff }) {
this.logger.info(`Pong received from '${nodeID}' - Time: ${elapsedTime}ms, System time difference: ${timeDiff}ms`);
}
}
name: "test",
events: {
"$node.pong"({ nodeID, elapsedTime, timeDiff }) {
this.logger.info(`Pong received from '${nodeID}' - Time: ${elapsedTime}ms, System time difference: ${timeDiff}ms`);
}
}
});

broker.start().then(() => broker.transit.sendPing(/*nodeID*/));
Expand All @@ -101,16 +101,16 @@ let svc = broker.createService({

Signature:
```js
this.waitForServices(serviceNames: String|Array<String>, timeout: Number/*milliseconds*/, interval: Number/*milliseconds*/)
this.waitForServices(serviceNames: String|Array<String>, timeout: Number/*milliseconds*/, interval: Number/*milliseconds*/): Promise
```

## New error types
We added some new Moleculer error classes.
- `MoleculerRetryableError` - Common Retryable error
- `MoleculerServerError` - Common server error
- `MoleculerClientError` - Common client error
- `ServiceNotAvailable` - Service is registered but isn't available (no live nodes or CB disabled them)
- `ProtocolVersionMismatchError` - Invalid protocol version (if you connect with an older client (<= v0.10.0))
- `MoleculerRetryableError` - Common Retryable error. Caller retries the request if `retryCount > 0`.
- `MoleculerServerError` - Common server error (5xx).
- `MoleculerClientError` - Common client/request error (4xx).
- `ServiceNotAvailable` - Raises if the service is registered but isn't available (no live nodes or CB disabled them).
- `ProtocolVersionMismatchError` - Raises if connect a node with an older client (<= v0.10.0)).

# Other changes
- The cachers don't listen "cache.clean" event.
Expand Down

0 comments on commit 6b46fea

Please sign in to comment.