Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WBRIDGE and version 7.3.0
Div
Classe2e-refDiv

Otp
Floatingfalse
maxHLevel1

Rp
Rde

Structure of a Node.js Service Repository

...

Code Block
languagehtml/xml
{
  "name": "HelloWorld",
  "version": "0.0.1",
  "description": "Hello world HTTP server",
  "scripts": {
  "start": "node server.js"
  },
}
ElementDescriptionMandatory
nameContains the name of the Node.js service as displayed on the Bridge. This is the name taken into account when applying the option Overwrite Service.mandatory
versionContains the version of the Node.js service.optional
descriptionContains a description of the Node.js service.optional
scripts/start

Contains the call to start the Node.js service: node <name of the start JavaScript file>.js

mandatory

Additional json elements can be added to package.json as needed (e.g. for adding packages/libraries), but will be ignored by the Bridge.

...

Multiexcerpt
MultiExcerptNameenvironment_variables
VariableDescriptionDefault

PORT

Node.js service port

-

CONFIG_DIR

Path to the configuration directory of the service (within the working directory of the service).

  • All configuration files (e.g. service settings) that are stored in this location will survive a Node.js service update. Files that have been saved to the working directory only, will be deleted on update.

  • This directory will be created by the Bridge on service startup, if not existent.

repository/config/local

E2E_CONF_ROOT

If you use the e2e-conf Node.js module, you can initialize e2e-conf with E2E_CONF_ROOT. This is especially useful if your e2e-conf is not a top level dependency but a sub-module dependency.

repository

E2E_LOGS

If the Node.js service writes log files in this directory, you can view them in the Bridge.

  • If the log file keeps growing, you should rotate the log file per day and use this naming pattern:

    <prefix>_YYYY-MM-DD.log.

  • If the log file has a fixed size, you can use the naming pattern <prefix>.log.

Do not use the following prefixes: start, stdout, stderr and transaction. They are reserved prefixes by the Bridge.

logs

...

Info
iconfalse

If you are writing messages to log files that will be displayed on the Bridge (npm-install, start, stdout, stderr, custom logfiles), you must use UTF-8 encoding. If you do not, special characters may be displayed wrongly in the log view.

Trigger Bridge Monitoring From the Error Log

Bridge 7.3.0 The Bridge comes with a built-in monitoring functionality, which can catch failure events for any service running on the Bridge (see Bridge Monitoring). If such an error event occurs, the Bridge calls the registered monitoring service, that executes whatever has to be done in this case, for instance sending an e-mail to the system administrator. The monitoring service is just another SOAP service that is running on the Bridge and is registered as monitoring service.

The monitoring service has a standardized interface (see Monitoring ) to which you need to provide the necessary data with your Node.js log. Generally, all lines from stderr are written to the Bridge error log as they are. As the Bridge will read this information from your Node.js logs and provide it to the monitoring service, your log file should have the following structure:

Info
iconfalse

All values (except the actual error message)  are to be provided in square brackets.

Code Block
[Timestamp][Log Level][Service/Domain][Code][Unused 1][Unused 2] - Error Message
[09:09:43][Error][SAP-Interface/SAP][815A][][] - File not found.
Log Field NameDescriptionLog ExamplesMonitoring InterfaceMonitoring Examples
Timestamp

Timestamp in local system time, time part only. The Bridge will add the date part and convert the date/time to UTC.

The timestamp is the marker for the beginning of a log entry.

[09:09:43]timestamp2019-03-13T08:09:43Z
Log Level
The Bridge will only forward log messages with log level Error to the monitoring service. The given log level value will then be converted to lowercase (first letter uppercase).
[Error]
[ERROR]
levelError 
Service/ DomainService identifier of the Node.js service. Provide here two values separated by a '/'. The Bridge will split this value into service and type.[SAP_Interface/SAP]
serviceSAP_Interface
typeSAP 
CodeThe error code of the error.[815A]
[#156]
code815A
#156
Unused 1
Two dummy fields which are needed for internal compatibility reasons. If you log some information here, this will be ignored by the Bridge.[] 

Unused 2[]

Error Message

The actual error message, separated by ''.

The error message may contain multiple lines. The timestamp is the marker for the beginning of a new log entry.

 - File not found.
descriptionFile not found.

Automatically provided by the Bridge.
hoste2ebridge.e2e.ch 
Automatically provided by the Bridge.
processID4711
Automatically provided by the Bridge. The Bridge will provide this value as unknown to the monitoring service.
categoryunknown
Automatically provided by the Bridge.  The Bridge will provide the path to the corresponding Node.js service log file.
detailLocation/opt/E2E_BRIDGE_DATA/nodejs_SAP_Interface/logs/stderr_2019-03-19.log

Implementing a Service Shutdown Activity

...