Skip to content

migrationGuide

Thiago da Rosa de Bustamante edited this page Mar 28, 2018 · 5 revisions

Migration Guide

Migrating from version 2 to version 3

Tree Gateway 3.0 changes completely hwo the requests are logged. The 2.x version saved the aggregate information and not the raw data of each request. The 3.0 version builds a log object that is enriched with information collected along the request pipeline, according to events that occur during pipeline processing. The requestLog object is passed to a requestLog middleware, that is responsible to persist this information (saving it to a file, sending it to a redis, logstash, timescale or anything else).

Monitors that collect information about the machine are also removed. You can use other external agents for this purpose if you need.

The config files for APIs are slightly different from version 2.0. When you start the gateway, it will automatically upgrade the configurations already present on its redis to the new format. However, if you have some configuration YAML or JSON files that you want to manualy converto to the new format, you can use our migration tool.

Eg:

npm install -g tree-gateway-migration
treeGatewayMigration --from 2 --to 3 --api ./myfolder/**/*.yaml

Migrating from version 1 to version 2

The Tree Gateway 2.0 breaks compatibility with 1.0 version in some few points. Before update to the new version, ensure you have verified this changes:

Node Version:

We are recommending NodeJS 8 or newer. Starting from Tree Gateway version 2.0, we will be testing the gateway only in Node 8 and newer versions.

Middleware functions:

In version 2.0 if a middleware function needs to receive an option parameter to initialize the middleware, it needs to expose a factory=true property. So, you need to review any custom middleware you have created previously.

Clone this wiki locally