@ti-engine/core 1.3.3 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/README.md +106 -95
- package/bin/localization/labels.json +101 -98
- package/components/exchange/message-dispatcher.js +4 -4
- package/components/exchange/message-tracer.js +4 -3
- package/components/service-caller.js +1 -1
- package/components/service-consumer.js +2 -2
- package/components/service-instance.js +3 -3
- package/components/service-provider.js +2 -2
- package/integrations/redis-integration.js +11 -10
- package/package.json +3 -4
- package/utils/exceptions.js +117 -22
- package/utils/logger.js +1 -1
- package/utils/tools.js +142 -96
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
This document will contain the list of changes made to the framework. The format is based on the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
|
|
4
4
|
|
|
5
|
+
## Version 1.3.6
|
|
6
|
+
* feat(exceptions): add new exception code `E_GEN_INVALID_ARGUMENT_TYPE`
|
|
7
|
+
* feat(exceptions): add public enum with all HTTP codes exported as `httpCode` and typedef `TiHttpCode`. Use it as the type for the `httpCode` exception property
|
|
8
|
+
* feat(tools): add `description` property to enum objects
|
|
9
|
+
* feat(tools): add `contains` property to enum objects
|
|
10
|
+
* feat(tools)!: change enum factory behavior to create a copy of the seed object instead of modifying it (may break code relying on seed object mutation)
|
|
11
|
+
* refactor(exceptions): invalid `httpCode` inputs are coerced to `undefined`; `Exception.asJSON` includes `httpCode` only when defined
|
|
12
|
+
* refactor(tools): deprecate method `getEnumName` in favor of `enum.name`; removal planned for 1.4.0
|
|
13
|
+
* refactor(tools)!: remove method `createCSVFile` as it is unnecessary for the framework's operation. It also eliminates the dependency from `fs-extra` package
|
|
14
|
+
* refactor(tools)!: disallow reserved keys as enum names; make enum properties non-enumerable and freeze the enum object to enforce immutability (may affect code relying on enumeration/extension)
|
|
15
|
+
* fix(tools): fix a bug in the `RetryPolicy` class that caused the `maxAttempts` property to be ignored
|
|
16
|
+
* build(npm): update npm dependencies to their latest versions
|
|
17
|
+
* build(npm): remove `fs-extra` package as it is not used by the framework
|
|
18
|
+
* build(npm)!: bump the minimum supported Node.js version to 18.0.0
|
|
19
|
+
|
|
20
|
+
## Version 1.3.5
|
|
21
|
+
* fix(redis integration): fix a duplicated log entry on connection ready event if multiple observers are registered
|
|
22
|
+
* feat(service caller)!: change log level of error result in `process` method from `ERROR` to `DEBUG`. Implementers are expected to handle this and decide if the error should be propagated further or not
|
|
23
|
+
* docs: update and fix various issues with the `README.md` file
|
|
24
|
+
|
|
25
|
+
## Version 1.3.4
|
|
26
|
+
* fix(service instance): fix the way `ServiceConfiguration` is propagated via child classes and remove unnecessary defaults. Also update the relevant JSDoc
|
|
27
|
+
|
|
5
28
|
## Version 1.3.3
|
|
6
29
|
* feat(exceptions): add new parameter `includeData` to `Exception.asJSON` method which allows the exclusion of the data parameter from the returned JSON
|
|
7
30
|
* feat(exceptions): remove several excessive exception codes that were unlikely to be used
|
package/README.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# ti-engine core
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
3
9
|
Flexible framework for the creation of microservices with [node.js](https://nodejs.org/).
|
|
4
10
|
|
|
5
11
|
## Introduction
|
|
@@ -8,32 +14,32 @@ The **ti-engine** is an open source, free to use—both for personal and commerc
|
|
|
8
14
|
|
|
9
15
|
## Why ti-engine?
|
|
10
16
|
|
|
11
|
-
The framework is created based on a decade of professional experience with the utilized technologies and architectural approach.
|
|
17
|
+
The framework is created based on a decade of professional experience with the utilized technologies and architectural approach. Its primary goal is to provide you with a lightweight and flexible solution that can help you quickly build a microservice ecosystem with any degree of size and complexity.
|
|
12
18
|
|
|
13
19
|
This is what you gain by using **ti-engine** in your project:
|
|
14
20
|
|
|
15
|
-
* Simplicity
|
|
16
|
-
* Flexibility
|
|
17
|
-
* Reliability
|
|
18
|
-
* Security
|
|
19
|
-
* Scalability
|
|
20
|
-
* Containerization
|
|
21
|
+
* **Simplicity**: Begin productive work within minutes and get to codding your business logic
|
|
22
|
+
* **Flexibility**: Go as complex as you need to in your implementation
|
|
23
|
+
* **Reliability**: Message exchange between the services is constantly tracked across the entire ecosystem
|
|
24
|
+
* **Security**: Messages are encrypted in transit and cannot be modified by external agents
|
|
25
|
+
* **Scalability**: Serve mullions of requests by multiplying stateless service instances (hardware limitations still apply)
|
|
26
|
+
* **Containerization**: Go with containers from the very start as the framework is designed to work in such an environment
|
|
21
27
|
|
|
22
28
|
These are just some benefits **ti-engine** offers. Get to know it better to find out more ways in which it can help you improve productivity.
|
|
23
29
|
|
|
24
30
|
## Prerequisites & installation
|
|
25
31
|
|
|
26
|
-
Being a messaging system, the **ti-engine** relies on a message broker for the actual exchange of messages between microservice instances. The default implementation of the framework uses [Redis](https://redis.io/) cache
|
|
32
|
+
Being a messaging system, the **ti-engine** relies on a message broker for the actual exchange of messages between microservice instances. The default implementation of the framework uses [Redis](https://redis.io/) cache; however, you could create your own implementation using something like [Rabbit MQ](https://www.rabbitmq.com/). See the [Advanced topics](#advanced-topics) section of this documentation for guides on how to do this. For now let's focus on the default setup.
|
|
27
33
|
|
|
28
|
-
|
|
34
|
+
To run the basic **ti-engine** framework, you will need a couple of things:
|
|
29
35
|
|
|
30
|
-
* A local [node.js installation](https://nodejs.org/en/download/) with a minimum version of **
|
|
36
|
+
* A local [node.js installation](https://nodejs.org/en/download/) with a minimum version of **18.0.0**
|
|
31
37
|
* A local or remote [Redis cache installation](https://redis.io/download) with a minimum version of **5.0.14**
|
|
32
38
|
|
|
33
|
-
If you are working under Windows 10+ OS and you need to install Redis, take a look at this [guide](https://redis.com/blog/redis-on-windows-10/). You could also use [Redis Cloud](https://app.redislabs.com/) for development
|
|
39
|
+
If you are working under Windows 10+ OS and you need to install Redis, take a look at this [guide](https://redis.com/blog/redis-on-windows-10/). You could also use [Redis Cloud](https://app.redislabs.com/) for development as it offers a free basic account. You can configure your connection to a remote Redis server using the following ENV variables:
|
|
34
40
|
|
|
35
41
|
* `TI_MEMORY_CACHE_AUTH_KEY` can be used to provide the Redis password if there is any at all.
|
|
36
|
-
* `TI_MEMORY_CACHE_REDIS_DB` can be used to specify the Redis DB you want to use. Make sure to set the correct number as for example Redis Cloud only uses DB `0`.
|
|
42
|
+
* `TI_MEMORY_CACHE_REDIS_DB` can be used to specify the Redis DB you want to use. Make sure to set the correct number as, for example, Redis Cloud only uses DB `0`.
|
|
37
43
|
* `TI_MEMORY_CACHE_REDIS_HOST` can be used to provide the remote host. This can be an IP or URL depending on your setup.
|
|
38
44
|
* `TI_MEMORY_CACHE_REDIS_PORT` can be used to provide the remote port. By default, Redis uses `6379` however many implementations might use a custom port that needs to be specified in the connection settings.
|
|
39
45
|
|
|
@@ -41,10 +47,10 @@ To get the framework itself, use the command `npm install @ti-engine/core`. And
|
|
|
41
47
|
|
|
42
48
|
## Getting started
|
|
43
49
|
|
|
44
|
-
To start using the **ti-engine**, you will have to make sure that all prerequisites are available and operational. However, before we get to the fun part you need to also consider a couple of
|
|
50
|
+
To start using the **ti-engine**, you will have to make sure that all prerequisites are available and operational. However, before we get to the fun part, you need to also consider a couple of crucial things while working with this framework:
|
|
45
51
|
|
|
46
52
|
1. The runtime configuration of the framework can be customized using ENV variables. These can be provided to node.js in all the standard ways, but there is also an option to include an `.env` file.
|
|
47
|
-
2. It loads your framework-related custom scripts and files dynamically, but it always assumes their provided paths are relative to the _current working directory_ (i.e
|
|
53
|
+
2. It loads your framework-related custom scripts and files dynamically, but it always assumes their provided paths are relative to the _current working directory_ (i.e., it uses `process.cwd()` to resolve the file paths). Be mindful of that whenever you declare file paths in the various settings.
|
|
48
54
|
|
|
49
55
|
Once you have everything else ready, you should download the **ti-engine** tester module with the command `npm install @ti-engine/tester`. The tester module packages an example microservice that shows the basic approach for using the framework. To make sure everything is working properly, you should try and start the tester service:
|
|
50
56
|
|
|
@@ -54,54 +60,59 @@ Once you have everything else ready, you should download the **ti-engine** teste
|
|
|
54
60
|
3. If everything was done properly, you should see the following output:
|
|
55
61
|
|
|
56
62
|
```text
|
|
57
|
-
[timestamp]: [instance-id] - notice - Starting new instance of type 'tester-service' with instance ID '[instance-id]'.
|
|
63
|
+
[timestamp]: [instance-id] - notice - Starting new instance of type 'ti-tester-service' with instance ID '[instance-id]'.
|
|
64
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'system-cache' and is ready to be used.
|
|
65
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'connection-msg-responses-out' and is ready to be used.
|
|
66
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'connection-msg-requests-in' and is ready to be used.
|
|
67
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'connection-msg-requests-out' and is ready to be used.
|
|
68
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'connection-msg-responses-in' and is ready to be used.
|
|
58
69
|
[timestamp]: [instance-id] - info - Starting service registration process. There is NO default service handler provided.
|
|
59
70
|
[timestamp]: [instance-id] - info - Registration of defined services completed with 2 successful out of 2 total.
|
|
60
71
|
[timestamp]: [instance-id] - notice - Instance '[instance-id]' started successfully.
|
|
61
|
-
» {"nodeVersion":[node-version]}
|
|
62
|
-
[timestamp]: [instance-id] - info -
|
|
63
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379 (re)established by client 'system-cache' and is ready to be used.
|
|
64
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379 (re)established by client 'connection-msg-requests-in' and is ready to be used.
|
|
65
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379 (re)established by client 'connection-msg-requests-out' and is ready to be used.
|
|
66
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379 (re)established by client 'connection-msg-responses-in' and is ready to be used.
|
|
67
|
-
[timestamp]: [instance-id] - notice - Execution of service1 result:
|
|
72
|
+
» {"nodeVersion":[node-version],"operationMode":[mode]}
|
|
73
|
+
[timestamp]: [instance-id] - info - Execution of 'Test 1: Service call to a simple service without chained services' successful.
|
|
68
74
|
» {"isSuccessful":true,"payload":{"s1Timestamp":[timestamp]}}
|
|
69
|
-
[timestamp]: [instance-id] -
|
|
75
|
+
[timestamp]: [instance-id] - info - Execution of 'Test 2: Service call to a simple service with one chained service' successful.
|
|
70
76
|
» {"isSuccessful":true,"payload":{"s1Timestamp":[timestamp],"s2TimestampStart":[timestamp],"s2TimestampEnd":[timestamp]}}
|
|
77
|
+
[timestamp]: [instance-id] - info - Execution of 'Test 3: Service call to a non-existent service' successful.
|
|
78
|
+
» {"isSuccessful":false,"exception":{"exceptionID":[exception-id],"description":"The specified service is not found in the service registry."}}
|
|
79
|
+
[timestamp]: [instance-id] - notice - All service tests completed. Passed 3 out of 3.
|
|
71
80
|
```
|
|
72
81
|
|
|
73
|
-
Now let's
|
|
82
|
+
Now let's analyze that output. For the sake of completeness, the `[timestamp]` and `[instance-id]` are placeholders of the actual values you'll see there. The timestamps are in UTC and show a date followed by time.
|
|
74
83
|
|
|
75
|
-
At the start of the output log you can see a NOTICE that tells you a couple of important things:
|
|
84
|
+
At the start of the output log, you can see a `NOTICE` that tells you a couple of important things:
|
|
76
85
|
|
|
77
|
-
* The instance name - in this case `tester-service`. In the terminology of the framework, this is also known as a _service domain name_.
|
|
86
|
+
* The instance name - in this case `ti-tester-service`. In the terminology of the framework, this is also known as a _service domain name_.
|
|
78
87
|
* The _instance identifier_. It is an uuid string with a `ti-` prefix, that is generated by the framework at process start. It can and will be used to trace the messages during their movement through the microservice ecosystem. But more on that later.
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
The following five `INFO` lines inform you about the successful connections to Redis. The default configuration assumes that your Redis is running on localhost and uses the default port. If you have a different setup, you can provide the host and port via ENV variables. We'll cover that in the section [Using the framework](#using-the-framework).
|
|
90
|
+
|
|
91
|
+
Following that come a couple of `INFO` lines that inform you about the microservice interface state. The framework starts with the process of _business services_ registration within the service domain of the microservice `ti-tester-service` and successfully adds two such services. The necessary information for this is read from a JSON config file included in the package. We'll get into more details on what this all means in the section [Creating a microservice](#creating-a-microservice).
|
|
92
|
+
|
|
93
|
+
Once the initialization sequence has completed, the framework informs you that the microservice instance has started successfully with a `NOTICE` entry.
|
|
81
94
|
|
|
82
|
-
|
|
95
|
+
If the framework encountered an error during initialization instead, you would see something like this instead:
|
|
83
96
|
|
|
84
97
|
```text
|
|
85
|
-
[timestamp]: [instance-id] - notice - Starting new instance of type 'tester-service' with instance ID '[instance-id]'.
|
|
98
|
+
[timestamp]: [instance-id] - notice - Starting new instance of type 'ti-tester-service' with instance ID '[instance-id]'.
|
|
86
99
|
[timestamp]: [instance-id] - alert - Error detected in the instance startup script!
|
|
87
100
|
```
|
|
88
101
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
Finally, you should see a couple of execution statements with their results in JSON format.
|
|
102
|
+
Finally, you should see a sequence of test execution statements with their results in JSON format. These are the results of three business service calls that are part of the default tester microservice. The final `NOTICE` should indicate that all three tests have been completed successfully.
|
|
92
103
|
|
|
93
104
|
You can now kill the node process which should show you the following two lines:
|
|
94
105
|
|
|
95
106
|
```text
|
|
96
|
-
[timestamp]: [instance-id] - notice -
|
|
107
|
+
[timestamp]: [instance-id] - notice - [signal-code] event detected in main instance process.
|
|
97
108
|
[timestamp]: [instance-id] - notice - Instance '[instance-id]' shut down successfully.
|
|
98
109
|
```
|
|
99
110
|
|
|
100
|
-
The framework will always try to capture the shut-down event and log it
|
|
111
|
+
The framework will always try to capture the shut-down event and log it with the correct `[signal-code]`. This should work even in a container environment, but it might depend on your setup whether the last two entries will reach the logging system or not.
|
|
101
112
|
|
|
102
113
|
The tester module gets its starting configuration from an `.env` file included in the package. You can find more information about it later in the [Creating a microservice](#creating-a-microservice) section.
|
|
103
114
|
|
|
104
|
-
Before moving on, also take a good look at the file `bin/start-instance.js`. It should give you an idea
|
|
115
|
+
Before moving on, also take a good look at the file `bin/start-instance.js`. It should give you an idea of how the process of starting and stopping a microservice operates. In most cases this file should be enough as a starting script for your **ti-engine** based microservice applications. You can, of course, create your own starting script, but then you'll have to consider all necessary steps to properly handle the microservice instance.
|
|
105
116
|
|
|
106
117
|
## Architecture
|
|
107
118
|
|
|
@@ -117,46 +128,46 @@ See the following sections for more information on each of them.
|
|
|
117
128
|
|
|
118
129
|
### Tier 1 - Message exchange
|
|
119
130
|
|
|
120
|
-
This is the lowest framework tier, unless we count the actual data objects processed by the framework. As you already know, the foundational **ti-engine** concept is that of a messaging system. Therefore, the first tier provides an abstraction over a chosen message broker (Redis by default). That abstraction makes it easy to switch between message brokers whenever you want to without having to change anything above tier 1. It also provides several
|
|
131
|
+
This is the lowest framework tier, unless we count the actual data objects processed by the framework. As you already know, the foundational **ti-engine** concept is that of a messaging system. Therefore, the first tier provides an abstraction over a chosen message broker (Redis by default). That abstraction makes it easy to switch between message brokers whenever you want to without having to change anything above tier 1. It also provides several bonuses that can speed up your work—message encryption, message tracing, message observers, and others. More details about each of these features will be covered in the section [Using the framework](#using-the-framework).
|
|
121
132
|
|
|
122
|
-
Another important aspect for you to remember is that the message exchange is entirely _asynchronous_. This helps reduce system load and optimizes the usage of the available resources. Even so each node.js process can handle a limited
|
|
133
|
+
Another important aspect for you to remember is that the message exchange is entirely _asynchronous_. This helps reduce the system load and optimizes the usage of the available resources. Even so, each node.js process can handle a limited load. Therefore, you should plan for running multiple identical senders and receives to scale your solution. But more on that later.
|
|
123
134
|
|
|
124
135
|
For now, take a look at the following diagram:
|
|
125
136
|
|
|
126
|
-

|
|
137
|
+

|
|
127
138
|
|
|
128
|
-
It shows the standard flow of a message exchange between one sender and _n_ identical message receivers. The sender splits each message into an _envelope_ and a _payload_, then stores the payload in the shared cache and enqueues the envelope in the requests (destination) queue. Receivers can subscribe to that queue
|
|
139
|
+
It shows the standard flow of a message exchange between one sender and _n_ identical message receivers. The sender splits each message into an _envelope_ and a _payload_, then stores the payload in the shared cache and enqueues the envelope in the requests (destination) queue. Receivers can subscribe to that queue to fetch enqueued messages and process their contents. During the fetch sequence a receiver assembles the full message by getting the payload from the storage. This process is depicted by the blue flow lines.
|
|
129
140
|
|
|
130
|
-
After the processing is done the message payload is modified and the receiver sends the message back to the original sender using the same mechanism. It again splits the message into an envelope and a payload, stores the payload in the storage and enqueues the envelope in the sender response (source) queue. The sender will then assemble the message back and process the contained results. This process is depicted by the red flow lines.
|
|
141
|
+
After the processing is done, the message payload is modified, and the receiver sends the message back to the original sender using the same mechanism. It again splits the message into an envelope and a payload, stores the payload in the storage and enqueues the envelope in the sender response (source) queue. The sender will then assemble the message back and process the contained results. This process is depicted by the red flow lines.
|
|
131
142
|
|
|
132
|
-
In this scenario the framework
|
|
143
|
+
In this scenario the framework uses _Redis lists_ as queues for the message envelopes and _Redis hash_ as message payload storage. The splitting between envelope and payload is done to avoid unnecessary transportation of potentially large volumes of operational data between the microservices. Other message brokers might use a slightly different approach, but they should still adhere to the same logical flow.
|
|
133
144
|
|
|
134
145
|
The modules associated with this tier are all located in the `components/exchange/` folder. This is a short list of some terminology used here and in the JDoc inside the sourcecode itself:
|
|
135
146
|
|
|
136
|
-
* Message
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
147
|
+
* Class `Message`: a message is the actual data object processed by the framework. It consists of two parts—an envelope containing service information and a payload containing the actual data to be processed.
|
|
148
|
+
* Class `MessageSender`: a sender a specialized connector that is responsible for sending a message on its way to its destination. It does not handle the actual dispatch and delivery.
|
|
149
|
+
* Class `MessageReceiver`: a receiver is a specialized connector that is responsible for receiving messages at a predefined destination.
|
|
150
|
+
* Class `MessageExchange`: the exchange is the actual message processing engine. It handles sending and receiving messages via preconfigured message senders and message receivers.
|
|
151
|
+
* Class `MessageObserver`: an observer is a custom event listener that can be used to react on message `sent` and `received` events.
|
|
141
152
|
|
|
142
153
|
### Tier 2 - Service domains
|
|
143
154
|
|
|
144
|
-
This tier focuses on hosting and executing the _business logic_ of your application. It
|
|
155
|
+
This tier focuses on hosting and executing the _business logic_ of your application. It consists of _business services_ that process input data and return the result of the processing as output data. The business services are grouped in _service domains_, which are in turn hosted inside stateless _microservices_ also named _service instances_. All microservices are based on the `ServiceInstance` class, which establishes the basic framework structure and provides the basic functionality for the microservice lifecycle. It should not be used directly, however. Instead, there are two child types of `ServiceInstance` in **ti-engine** that you should use to implement your solution:
|
|
145
156
|
|
|
146
|
-
*
|
|
147
|
-
*
|
|
157
|
+
* Class `ServiceConsumer`: consumers are service instances that can call business services in any connected and available service domain.
|
|
158
|
+
* Class `ServiceProvider`: providers are service instances that host and run a set of business services in a particular service domain. Every service provider is also a service consumer.
|
|
148
159
|
|
|
149
|
-
The various service instances in a solution represent a network of interconnected service domains that contain the business logic of your application. All business services exchange data via _service calls_ using abstract _service addresses_. These service calls are transported from one address in the microservice network to another via the underlying message exchange tier. This, however, is completely transparent to the service instances. In essence, tier 2 does not care about the actual data transportation method or protocol. You could in fact change
|
|
160
|
+
The various service instances in a solution represent a network of interconnected service domains that contain the business logic of your application. All business services exchange data via _service calls_ using abstract _service addresses_. These service calls are transported from one address in the microservice network to another via the underlying message exchange tier. This, however, is completely transparent to the service instances. In essence, tier 2 does not care about the actual data transportation method or protocol. You could, in fact, completely change the tier 1 approach without having to modify anything in your business logic and business flow.
|
|
150
161
|
|
|
151
|
-
This tier is the place to
|
|
162
|
+
This tier is the place to use any databases, file storages, integrations with other applications, scheduling jobs, and so on. In general, it should focus on executing any granular tasks that are essential to the backbone operation of your application. The business logic here should remain **stateless** and any user context should be provided at runtime to each invoked business service. We'll see more concrete examples for that later in the section [Using the framework](#using-the-framework).
|
|
152
163
|
|
|
153
164
|
### Tier 3 - Solution implementation
|
|
154
165
|
|
|
155
|
-
This tier comprises the actual implementation of your application. Its structure and behavior
|
|
166
|
+
This tier comprises the actual implementation of your application. Its structure and behavior depend entirely on your vision and business goals. There are still a couple of points that remain constant while using **ti-engine**:
|
|
156
167
|
|
|
157
|
-
* It needs to
|
|
158
|
-
* It needs to take care of any type of stateful behavior like user sessions or transactions
|
|
159
|
-
* It needs to act as the primary interface between users and your application thus handling access management and user interactions
|
|
168
|
+
* It needs to use the business logic defined in tier 2 by calling the business services.
|
|
169
|
+
* It needs to take care of any type of stateful behavior like user sessions or transactions.
|
|
170
|
+
* It needs to act as the primary interface between users and your application, thus handling access management and user interactions.
|
|
160
171
|
|
|
161
172
|
Depending on the type of software you are building, tier 3 can be an API Gateway, a Web application, backend for a Mobile application or anything like that.
|
|
162
173
|
|
|
@@ -215,31 +226,31 @@ TI_INSTANCE_NAME=tester-service
|
|
|
215
226
|
TI_AUDITING_LOG_MIN_LEVEL=200
|
|
216
227
|
```
|
|
217
228
|
|
|
218
|
-
The ENV initialization file provides the minimal settings for the proper tester microservice operation. The first three are usually _mandatory_ for every microservice you create while the last is provided for the needs of the tester demonstration. Let's review them and see what they do:
|
|
229
|
+
The ENV initialization file provides the minimal settings for the proper tester microservice operation. The first three are usually _mandatory_ for every microservice you create, while the last is provided for the needs of the tester demonstration. Let's review them and see what they do:
|
|
219
230
|
|
|
220
|
-
* `TI_INSTANCE_CLASS` specifies the relative path to the implementation of the `ServiceInstance` framework class—in this case a `ServiceProvider`. As stated above, the path is relative to the working directory of the `node` process. This variable is mandatory for every microservice you create with the **ti-engine**. If it is not provided the microservice won't be able to start at all, and you will get an exception.
|
|
221
|
-
* `TI_INSTANCE_CONFIG` specifies the relative path to the configuration data for the microservice. We'll delve into the specific settings below. Technically, you can omit this variable and the microservice will still start successfully with an empty configuration. There are very few cases, however, where this would be applicable.
|
|
222
|
-
* `TI_INSTANCE_NAME` is the _service domain_ name provided for the microservice. It has to be _unique_ in the context of the microservice ecosystem. If not provided, the framework will attempt to extract this information from the name of the implementation file. That is not a recommended approach though as it might cause hard to identify errors later.
|
|
223
|
-
* `TI_AUDITING_LOG_MIN_LEVEL` specifies the minimum log level that should be sent to the log output stream. With a setting of `200` (corresponding to INFO) we filter out all `DEFAULT(0)` and `DEBUG(100)` entries as we don't need them for the
|
|
231
|
+
* `TI_INSTANCE_CLASS` specifies the relative path to the implementation of the `ServiceInstance` framework class—in this case a `ServiceProvider`. As stated above, the path is relative to the working directory of the `node` process. This variable is mandatory for every microservice you create with the **ti-engine**. If it is not provided, the microservice won't be able to start at all, and you will get an exception.
|
|
232
|
+
* `TI_INSTANCE_CONFIG` specifies the relative path to the configuration data for the microservice. We'll delve into the specific settings below. Technically, you can omit this variable, and the microservice will still start successfully with an empty configuration. There are very few cases, however, where this would be applicable.
|
|
233
|
+
* `TI_INSTANCE_NAME` is the _service domain_ name provided for the microservice. It has to be _unique_ in the context of the microservice ecosystem. If not provided, the framework will attempt to extract this information from the name of the implementation file. That is not a recommended approach, though, as it might cause hard to identify errors later.
|
|
234
|
+
* `TI_AUDITING_LOG_MIN_LEVEL` specifies the minimum log level that should be sent to the log output stream. With a setting of `200` (corresponding to INFO) we filter out all `DEFAULT(0)` and `DEBUG(100)` entries as we don't need them for the tester microservice.
|
|
224
235
|
|
|
225
236
|
You can find the full list of available ENV variables and what they do below in [Using the framework](#using-the-framework) section.
|
|
226
237
|
|
|
227
|
-
#### Application
|
|
238
|
+
#### Application-specific files
|
|
228
239
|
|
|
229
240
|
Now let's look inside the `bin` folder. The two files there are the ones specified in the `.env` file. The `tester-service.js` contains the implementation of the `ServiceProvider` class. It has just a few methods that contain its behavior:
|
|
230
241
|
|
|
231
|
-
* Method `onStart` overrides the base one from the parent class and is invoked automatically by the framework once initialization of the microservice is complete. In this case the method invokes the execution of the test sequence just once and then the microservice remains dormant but active.
|
|
242
|
+
* Method `onStart` overrides the base one from the parent class and is invoked automatically by the framework once initialization of the microservice is complete. In this case the method invokes the execution of the test sequence just once, and then the microservice remains dormant but active.
|
|
232
243
|
* Method `reportHealthy` overrides but essentially just calls the same base method. Its only purpose here is to draw your attention to its existence and the possibility to implement your own health status reporting functionality if you want.
|
|
233
244
|
* Method `verifyAccess` also overrides the base method and shows a very basic example of how to implement user access verification on business service level. Each time a service in the `ti-tester-service` is called, the framework will trigger this method and will only allow processing if there is a non-undefined value inside the `authToken` variable.
|
|
234
|
-
* Method `#executeTests` is a custom private method that contains the test sequence itself. It is called by the `onStart` method just once per microservice start. Inside you can see two examples of calling a business service—in both cases the tester microservice is calling itself. In more practical situation, however, these calls would be directed towards other service domains.
|
|
245
|
+
* Method `#executeTests` is a custom private method that contains the test sequence itself. It is called by the `onStart` method just once per microservice start. Inside you can see two examples of calling a business service—in both cases the tester microservice is calling itself. In a more practical situation, however, these calls would be directed towards other service domains.
|
|
235
246
|
|
|
236
|
-
The file `tester-service.json` contains framework configuration for the tester microservice. It will be automatically loaded inside the `ServiceInstance` class during initialization and will already be available inside the `onStart` method for usage. In this case the configuration is related to the two business services that will be provided by the microservice. More on this topic will be covered in section [Using the framework](#using-the-framework). For now
|
|
247
|
+
The file `tester-service.json` contains framework configuration for the tester microservice. It will be automatically loaded inside the `ServiceInstance` class during initialization and will already be available inside the `onStart` method for usage. In this case the configuration is related to the two business services that will be provided by the microservice. More on this topic will be covered in the section [Using the framework](#using-the-framework). For now pay attention to the `serviceFile` parameter and that it once again provides a relative path to the actual file containing the business logic.
|
|
237
248
|
|
|
238
|
-
The final two files are located in `bin/services/v1/` folder. They contain the definitions and business logic of the two business services that will be loaded at initialization time and provided by the tester microservice. In this case `service1.js` contains a
|
|
249
|
+
The final two files are located in `bin/services/v1/` folder. They contain the definitions and business logic of the two business services that will be loaded at initialization time and provided by the tester microservice. In this case `service1.js` contains a basic service that returns the current timestamp. The `service2.js` file contains a slightly more complex example of a service calling another service (in this case `service1`) before also returning two timestamps taken at the beginning and end of execution. Pay attention to the way the methods inside are declared and exported as this is the proper way to do this while using the **ti-engine** framework. Once again, we'll delve into the details and specifics of creating business services in the section [Using the framework](#using-the-framework).
|
|
239
250
|
|
|
240
251
|
### Creating your own microservice
|
|
241
252
|
|
|
242
|
-
Now that we've seen the structure of the tester microservice, let's create a new one and make it call `service2`. Let's use
|
|
253
|
+
Now that we've seen the structure of the tester microservice, let's create a new one and make it call `service2`. Let's use the same file structure as for the tester. Create a folder `my-service` and in it create a `package.json` file. Make sure to include a dependency to `"@ti-engine/core": "latest"` in it. After that create a `.env` file and add the following entries in it:
|
|
243
254
|
|
|
244
255
|
```text
|
|
245
256
|
TI_INSTANCE_CLASS=bin/my-service.js
|
|
@@ -258,7 +269,7 @@ class MyService extends ServiceConsumer {}
|
|
|
258
269
|
module.exports = MyService;
|
|
259
270
|
```
|
|
260
271
|
|
|
261
|
-
|
|
272
|
+
Remember to also export your new class at the end, otherwise the framework won't be able to initialize it.
|
|
262
273
|
|
|
263
274
|
To make use of all the inherited features of the `ServiceConsumer` class we have to add a `constructor` that invokes the base one in the parent class:
|
|
264
275
|
|
|
@@ -274,7 +285,7 @@ class MyService extends ServiceConsumer {
|
|
|
274
285
|
module.exports = MyService;
|
|
275
286
|
```
|
|
276
287
|
|
|
277
|
-
And now let's add a service call
|
|
288
|
+
And now let's add a service call executed at microservice start after `500` milliseconds timeout:
|
|
278
289
|
|
|
279
290
|
```js
|
|
280
291
|
const ServiceConsumer = require( "@ti-engine/core/service-consumer" );
|
|
@@ -311,40 +322,40 @@ class MyService extends ServiceConsumer {
|
|
|
311
322
|
module.exports = MyService;
|
|
312
323
|
```
|
|
313
324
|
|
|
314
|
-
Now let's start the new microservice with `node .\node_modules\@ti-engine\core\bin\start-instance.js` command. Remember, you need to execute this inside the `my-service` folder you created for this exercise. If everything was configured correctly you should get the following output:
|
|
325
|
+
Now let's start the new microservice with `node .\node_modules\@ti-engine\core\bin\start-instance.js` command. Remember, you need to execute this inside the `my-service` folder you created for this exercise. If everything was configured correctly, you should get the following output:
|
|
315
326
|
|
|
316
327
|
```text
|
|
317
328
|
[timestamp]: [instance-id] - notice - Starting new instance of type 'my-service' with instance ID '[instance-id]'.
|
|
318
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379
|
|
319
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379
|
|
320
|
-
[timestamp]: [instance-id] - info - Connection to Redis server 127.0.0.1:6379
|
|
329
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'system-cache' and is ready to be used.
|
|
330
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'connection-msg-responses-in' and is ready to be used.
|
|
331
|
+
[timestamp]: [instance-id] - info - Connection to Redis server '127.0.0.1:6379' established by client 'connection-msg-requests-out' and is ready to be used.
|
|
321
332
|
```
|
|
322
333
|
|
|
323
334
|
If you haven't started anything else, this is all you should see at this point.
|
|
324
335
|
|
|
325
|
-
Now without exiting this node process let's start the original tester microservice as well. Once it initializes and does its work take a look at the output logs of the `my-service` process:
|
|
336
|
+
Now without exiting this node process, let's start the original tester microservice as well. Once it initializes and does its work take a look at the output logs of the `my-service` process:
|
|
326
337
|
|
|
327
338
|
```text
|
|
328
339
|
...
|
|
329
|
-
[timestamp]: [instance-id] - notice - Execution of service2 result:
|
|
330
|
-
» {"isSuccessful":true,"payload":{"s1Timestamp":[timestamp],"s2TimestampStart":[timestamp],"s2TimestampEnd":[timestamp]}}
|
|
331
340
|
[timestamp]: [instance-id] - notice - Instance [instance-id] started successfully.
|
|
332
341
|
» {"nodeVersion":[node-version]}
|
|
342
|
+
[timestamp]: [instance-id] - notice - Execution of service2 result:
|
|
343
|
+
» {"isSuccessful":true,"payload":{"s1Timestamp":[timestamp],"s2TimestampStart":[timestamp],"s2TimestampEnd":[timestamp]}}
|
|
333
344
|
```
|
|
334
345
|
|
|
335
|
-
This means the service call processing was successful and result was returned to `my-service`. Because we made the receiving of the result blocking and part of the initialization sequence, the new microservice did not report successful startup until it received that response from `ti-tester-service`.
|
|
346
|
+
This means the service call processing was successful and a result was returned to `my-service`. Because we made the receiving of the result blocking and part of the initialization sequence, the new microservice did not report successful startup until it received that response from `ti-tester-service`.
|
|
336
347
|
|
|
337
|
-
And with this step we are done. The new microservice is now operational. You can continue to tweak and play with it
|
|
348
|
+
And with this step we are done. The new microservice is now operational. You can continue to tweak and play with it to understand better how it all works. For more details on the **ti-engine** inner working, please see the following sections.
|
|
338
349
|
|
|
339
350
|
## Using the framework
|
|
340
351
|
|
|
341
352
|
### Environment variables
|
|
342
353
|
|
|
343
|
-
These are the system-level ENV variables that can be used to configure the framework. Use
|
|
354
|
+
These are the system-level ENV variables that can be used to configure the framework. Use an `.env` file or corresponding containerization features to set the variables you need. Not all of these are mandatory or even required for every microservice you create. Consult the documentation for more details.
|
|
344
355
|
|
|
345
356
|
TI_AUDITING_LOG_MIN_LEVEL
|
|
346
357
|
: Type: Optional
|
|
347
|
-
: Specifies the minimum log level that should be sent to the log output stream. The framework will filter out all log entries with level below this value. The default value is `200` (corresponding to INFO).
|
|
358
|
+
: Specifies the minimum log level that should be sent to the log output stream. The framework will filter out all log entries with a level below this value. The default value is `200` (corresponding to INFO).
|
|
348
359
|
|
|
349
360
|
TI_FAIL_FAST_ON_UNHANDLED_OFF
|
|
350
361
|
: Type: Optional
|
|
@@ -352,39 +363,39 @@ TI_FAIL_FAST_ON_UNHANDLED_OFF
|
|
|
352
363
|
|
|
353
364
|
TI_INSTANCE_CLASS
|
|
354
365
|
: Type: Required
|
|
355
|
-
: Specifies the relative path to the implementation of the `ServiceInstance` framework class—in this case a `ServiceProvider`. As stated above, the path is relative to the working directory of the `node` process. This variable is mandatory for every microservice you create with the **ti-engine**. If it is not provided the microservice won't be able to start at all, and you will get an exception.
|
|
366
|
+
: Specifies the relative path to the implementation of the `ServiceInstance` framework class—in this case a `ServiceProvider`. As stated above, the path is relative to the working directory of the `node` process. This variable is mandatory for every microservice you create with the **ti-engine**. If it is not provided, the microservice won't be able to start at all, and you will get an exception.
|
|
356
367
|
|
|
357
368
|
TI_INSTANCE_CONFIG
|
|
358
369
|
: Type: Optional
|
|
359
|
-
: Specifies the relative path to the configuration data for the microservice. Technically, you can omit this variable and the microservice will still start successfully with an empty configuration. There are very few cases, however, where this would be applicable.
|
|
370
|
+
: Specifies the relative path to the configuration data for the microservice. Technically, you can omit this variable, and the microservice will still start successfully with an empty configuration. There are very few cases, however, where this would be applicable.
|
|
360
371
|
|
|
361
372
|
TI_INSTANCE_NAME
|
|
362
373
|
: Type: Required
|
|
363
|
-
: Specifies the _service domain_ name provided for the microservice. It has to be _unique_ in the context of the microservice ecosystem. If not provided, the framework will attempt to extract this information from the name of the implementation file. That is not a recommended approach though as it might cause hard to identify errors later.
|
|
374
|
+
: Specifies the _service domain_ name provided for the microservice. It has to be _unique_ in the context of the microservice ecosystem. If not provided, the framework will attempt to extract this information from the name of the implementation file. That is not a recommended approach, though, as it might cause hard to identify errors later.
|
|
364
375
|
|
|
365
376
|
### Framework settings
|
|
366
377
|
|
|
367
|
-
Here you can find all settings used by **ti-engine** together with information on what they do. They are defined inside the `config` module and the full list can be accessed through the public `setting` enum. To get the current value of a setting, you can use the public method `getSetting` from the same module. Some settings can be overridden by providing ENV variables as specified below at node application
|
|
378
|
+
Here you can find all settings used by **ti-engine** together with information on what they do. They are defined inside the `config` module and the full list can be accessed through the public `setting` enum. To get the current value of a setting, you can use the public method `getSetting` from the same module. Some settings can be overridden by providing ENV variables as specified below at node application startup.
|
|
368
379
|
|
|
369
380
|
AUDITING_LOG_CONSOLE_ENABLED
|
|
370
381
|
: JSON path `auditing.logConsoleEnabled`, type `boolean`, default `true`
|
|
371
382
|
: ENV variable `TI_AUDITING_LOG_CONSOLE_ENABLED`
|
|
372
|
-
: This setting controls whether the `auditing` module will send the log entries to the OS console or not. In some cases, like Cloud environments, you might want to disable this, especially if the OS console is not made available. This functions independently of other logging outputs like for example GCloud error reporting.
|
|
383
|
+
: This setting controls whether the `auditing` module will send the log entries to the OS console or not. In some cases, like Cloud environments, you might want to disable this, especially if the OS console is not made available. This functions independently of other logging outputs like, for example, GCloud error reporting.
|
|
373
384
|
|
|
374
385
|
AUDITING_LOG_DETAILS
|
|
375
386
|
: JSON path `auditing.logDetails`, type `boolean`, default `true`
|
|
376
387
|
: ENV variable `TI_AUDITING_LOG_DETAILS`
|
|
377
|
-
: This setting controls whether the `auditing` module will include the log entry details (located in the `data` property) in the final log output. You might want to disable this if you want a leaner log output or the log entry details are not something you plan to use for analysis later.
|
|
388
|
+
: This setting controls whether the `auditing` module will include the log entry details (located in the `data` property) in the final log output. You might want to disable this if you want a leaner log output, or the log entry details are not something you plan to use for analysis later.
|
|
378
389
|
|
|
379
390
|
AUDITING_LOG_MIN_LEVEL
|
|
380
391
|
: JSON path `auditing.logMinLevel`, type `number`, default `0`
|
|
381
392
|
: ENV variable `TI_AUDITING_LOG_MIN_LEVEL`
|
|
382
|
-
: This setting controls the minimum log severity level that the framework will log in the log output. You can and should set this to `200` (INFO) for production environments
|
|
393
|
+
: This setting controls the minimum log severity level that the framework will log in the log output. You can and should set this to `200` (INFO) for production environments to filter out the DEBUG and the low-level DEFAULT entries.
|
|
383
394
|
|
|
384
395
|
AUDITING_LOG_USES_JSON
|
|
385
396
|
: JSON path `auditing.logUsesJSON`, type `boolean`, default `false`
|
|
386
397
|
: ENV variable `TI_AUDITING_LOG_USES_JSON`
|
|
387
|
-
: This setting controls whether the log entries would be sent to output formatted as JSONs or not. By default, the framework outputs log entries as prettified text. In some cases however you might want to have the entire entry as a JSON for further processing (for example if you're sending all logs to Elasticsearch).
|
|
398
|
+
: This setting controls whether the log entries would be sent to output formatted as JSONs or not. By default, the framework outputs log entries as prettified text. In some cases, however, you might want to have the entire entry as a JSON for further processing (for example, if you're sending all logs to Elasticsearch).
|
|
388
399
|
|
|
389
400
|
GCLOUD_API_KEY (Alpha)
|
|
390
401
|
: JSON path `gcloudIntegration.apiKey`
|
|
@@ -397,7 +408,7 @@ GCLOUD_PROJECT_ID (Alpha)
|
|
|
397
408
|
LOCALIZATION_LABELS_PATH
|
|
398
409
|
: JSON path `localization.labelsPath`, type `Array<string>`, default `[]`
|
|
399
410
|
: ENV variable `TI_LOCALIZATION_LABELS_PATH`
|
|
400
|
-
: This setting holds a list of paths to custom `.json` files containing additional localization information. By default, the framework also provides such a file with
|
|
411
|
+
: This setting holds a list of paths to custom `.json` files containing additional localization information. By default, the framework also provides such a file with English texts that can be customized further. All additional JSONs in these files have to follow the rules and structure of the `localization` module. The ENV variable currently supports providing only a single custom path.
|
|
401
412
|
|
|
402
413
|
LOCALIZATION_LANGUAGE
|
|
403
414
|
: JSON path `localization.language`, type `string`, default `en`
|
|
@@ -407,12 +418,12 @@ LOCALIZATION_LANGUAGE
|
|
|
407
418
|
MEMORY_CACHE_AUTH_KEY
|
|
408
419
|
: JSON path `memoryCache.authKey`, type `string`, default `undefined`
|
|
409
420
|
: ENV variable `TI_MEMORY_CACHE_AUTH_KEY`
|
|
410
|
-
: This setting holds the Redis password for accessing the Redis server if such password is required.
|
|
421
|
+
: This setting holds the Redis password for accessing the Redis server if such a password is required.
|
|
411
422
|
|
|
412
423
|
MEMORY_CACHE_REDIS_DB
|
|
413
424
|
: JSON path `memoryCache.redisDB`, type `number`, default `0`
|
|
414
425
|
: ENV variable `TI_MEMORY_CACHE_REDIS_DB`
|
|
415
|
-
: This setting specifies the Redis DB to be used for all operations. When setting this make sure that the Redis server actually supports multiple DBs (for example Redis Cloud has only one DB with ID `0`).
|
|
426
|
+
: This setting specifies the Redis DB to be used for all operations. When setting this make sure that the Redis server actually supports multiple DBs (for example, Redis Cloud has only one DB with ID `0`).
|
|
416
427
|
|
|
417
428
|
MEMORY_CACHE_REDIS_HOST
|
|
418
429
|
: JSON path `memoryCache.redisHost`, type `string`, default `127.0.0.1`
|
|
@@ -427,7 +438,7 @@ MEMORY_CACHE_REDIS_PORT
|
|
|
427
438
|
MEMORY_CACHE_RETRY_MAX_ATTEMPTS
|
|
428
439
|
: JSON path `memoryCache.retryMaxAttempts`, type `number`, default `undefined`
|
|
429
440
|
: ENV variable `TI_MEMORY_CACHE_RETRY_MAX_ATTEMPTS`
|
|
430
|
-
: This setting holds the maximum number of attempts to (re)connect to the Redis server. By default there is no limit.
|
|
441
|
+
: This setting holds the maximum number of attempts to (re)connect to the Redis server. By default, there is no limit.
|
|
431
442
|
|
|
432
443
|
MEMORY_CACHE_RETRY_MAX_INTERVAL
|
|
433
444
|
: JSON path `memoryCache.retryMaxInterval`, type `number`, default `1000`
|
|
@@ -450,12 +461,12 @@ MESSAGE_EXCHANGE_MESSAGE_STORE (Advanced)
|
|
|
450
461
|
MESSAGE_EXCHANGE_SECURITY_HASH_ENABLED (Advanced)
|
|
451
462
|
: JSON path `messageExchange.securityHashEnabled`, type `boolean`, default `true`
|
|
452
463
|
: ENV variable `TI_MESSAGE_EXCHANGE_SECURITY_HASH_ENABLED`
|
|
453
|
-
: This setting controls whether the message exchange will use a control hash mechanism to ensure there is no tampering with the messages in between service calls. In most cases you would want to keep this enabled since it ensures the integrity of your data. If you are concerned about performance (hashing with `blake2` is
|
|
464
|
+
: This setting controls whether the message exchange will use a control hash mechanism to ensure there is no tampering with the messages in between service calls. In most cases you would want to keep this enabled since it ensures the integrity of your data. If you are concerned about performance (hashing with `blake2` is rapid, but it still eats some milliseconds) you might want to try and disable this to see if it makes any notable difference.
|
|
454
465
|
|
|
455
466
|
MESSAGE_EXCHANGE_SECURITY_HASH_KEY (Advanced)
|
|
456
467
|
: JSON path `messageExchange.securityHashKey`, type `string`, default `random uuid`
|
|
457
468
|
: ENV variable `TI_MESSAGE_EXCHANGE_SECURITY_HASH_KEY`
|
|
458
|
-
: This setting holds the encryption key used by the message exchange control hash mechanism. By default, this has a random uuid value that can be used for development
|
|
469
|
+
: This setting holds the encryption key used by the message exchange control hash mechanism. By default, this has a random uuid value that can be used for development only. For production environments you absolutely must provide your own encryption key via the ENV variable. Depending on your configuration and infrastructure, it might come from a secure storage, HSM, key vault, etc.
|
|
459
470
|
|
|
460
471
|
MESSAGE_EXCHANGE_TRACE_EXPIRATION_TIME
|
|
461
472
|
: JSON path `messageExchange.traceExpirationTime`, type `number`, default `3600`
|
|
@@ -464,7 +475,7 @@ MESSAGE_EXCHANGE_TRACE_EXPIRATION_TIME
|
|
|
464
475
|
MESSAGE_EXCHANGE_TRACE_LOG_ENABLED
|
|
465
476
|
: JSON path `messageExchange.traceLogEnabled`, type `boolean`, default `false`
|
|
466
477
|
: ENV variable `TI_MESSAGE_EXCHANGE_TRACE_LOG_ENABLED`
|
|
467
|
-
: This setting controls whether the `auditing` module should output all trace messages as normal log entries or not. Normally, you don't want that since it will clutter the standard log quite a lot. All traces go their own storage and can be reviewed and processed separately from the log entries. In some cases, however, as in debugging, enabling this can help you identify hard to track problem.
|
|
478
|
+
: This setting controls whether the `auditing` module should output all trace messages as normal log entries or not. Normally, you don't want that since it will clutter the standard log quite a lot. All traces go to their own storage and can be reviewed and processed separately from the log entries. In some cases, however, as in debugging, enabling this can help you identify a hard to track problem.
|
|
468
479
|
|
|
469
480
|
MESSAGE_EXCHANGE_TRACE_REPOSITORY (Advanced)
|
|
470
481
|
: JSON path `messageExchange.traceRepository`, type `string`, default `ti:messages:trace`
|
|
@@ -488,7 +499,7 @@ SERVICE_HEALTH_CHECK_TIMEOUT (Advanced)
|
|
|
488
499
|
|
|
489
500
|
SERVICE_REGISTRY_ADDRESS (Advanced)
|
|
490
501
|
: JSON path `serviceConfig.serviceRegistryAddress`, type `string`, default `ti:services:registry:catalog:`
|
|
491
|
-
: This setting holds the prefix of the Redis key name used as business service registry. If the microservice is a `ServiceProvider`, on start up it will register its business service portfolio in that Redis set. Also, on each service call that same registry will be searched for the existence of the called business service. This is not something you should modify unless you are making a customized implementation of the tier 1 architectural layer.
|
|
502
|
+
: This setting holds the prefix of the Redis key name used as a business service registry. If the microservice is a `ServiceProvider`, on start up it will register its business service portfolio in that Redis set. Also, on each service call that same registry will be searched for the existence of the called business service. This is not something you should modify unless you are making a customized implementation of the tier 1 architectural layer.
|
|
492
503
|
|
|
493
504
|
OPERATION_MODE
|
|
494
505
|
: JSON path `operationMode`, type `string`, default `production`
|