File structure

Configuration is defined in YAML files (their location was discussed in previous chapters) and consists of the following sections:

  • 'SERVERS' - definitions of entry points used for communication with a microservice.
  • 'PROPERTIES' - list of runtime parameters of a microservice.
  • 'INITIALIZING_LOGGER' - configuration of microservice logger (the initialization phase).
  • 'MEMORY_ERRORS' - configuration of Memory Process Keeper for a microservice
  • 'THREAD_POOLS' - custom thread pools definitions


Description

Section 'SERVERS'

The section contains subsections, which are definitions of each entry point. There are two subsections, each relates to particular entry point. The name of a subsection is the name of entry point.

The appropriate part of the configuration file:

SERVERS:
  HTTP:
    type: spring_boot
    httpPrimaryPort: -1
    httpSecondaryPort: -1
    waitForFinishExecuteAllRequests: true
    waitToShutdownThreadsOnStop: 5000
    springBootLoaderClassName: org.springframework.boot.loader.WarLauncher
    contextName: /exchange
    isStartOnMainServerInitialize: true
    httpStickySession: false
  TRANSMISSION:
    readTimeout: 480000
    isWaitForFinishExecuteAllRequests: false
    waitToShutdownThreadsOnStop: 60000
    backlog: 0
    receiveBufferSize: 0
    isReuseAddress: false
    threadPoolSize: 8
    isLogPeriodicOnDebug: true
    isDestroyThreadOnTimeout: false
    threadExecutingTimeOut: 3600000
    isStartOnMainServerInitialize: true
[...]

Description:

Entry point Parameter Description
HTTP type The type of servlet implementation. The recommended type is 'spring_boot'.
HTTP httpPrimaryPort The primary port number of HTTP entry point. The 'primary' means that this port is used after the microservice is started during main server initialization or after the microservice has been stopped. If '-1' value is set the Main Server assigns dynamic ports for the microservice.
HTTP httpSecondaryPort The secondary port number of HTTP entry point. The 'secondary' means that this port is used after the microservice is restarted while it uses the 'primary' port. The port switches after each restart. If '-1' value is set the Main Server assigns dynamic ports for a microservice.
HTTP waitForFinishExecuteAllRequests This parameter is ignored, for future use
HTTP waitToShutdownThreadsOnStop Graceful shutdown timeout. The time in milliseconds that main server waits to complete all requests. After this timeout the Main Server will terminate the microservice regardless the status of requests processing.
HTTP springBootLoaderClassName The class name that is initialized during microservice's start
HTTP contextName The context under which the application in SpringBoot is available.
HTTP isStartOnMainServerInitialize The switch that determines if the logical service is started during Main Server startup procedure.
HTTP httpStickySession The switch that determines if balancing performed by JLupin Edge Balancer for context provided by this microservice should be persistent (first request hits any microservice, but next ones hit the same microservice)
TRANSMISSION readTimeout The maximum time in milliseconds that a socket is ready to handle traffic, after this timeout the another initialization is needed and a socket is unavailable for some time. If you interested in reading more about it, please refer to Oracle's official documentation. USE WITH CAUTION !
TRANSMISSION isWaitForFinishExecuteAllRequests Graceful shutdown switch. It determines whether the Main Server waits to complete all requests before it stops.
TRANSMISSION waitToShutdownThreadsOnStop Graceful shutdown timeout. The time in milliseconds that main server waits to complete all requests. After this timeout the Main Server will terminate the microservice regardless the status of requests processing.
TRANSMISSION backlog The maximum queue length for incoming connections. If you interested in reading more about it, please refer to Oracle's official documentation. USE WITH CAUTION !
TRANSMISSION receiveBufferSize The value of this parameter is used both to set the size of the internal socket receive buffer, and to set the size of the TCP receive window that is advertised to the remote peer. If you interested in reading more about it, please refer to Oracle's official documentation. USE WITH CAUTION !
TRANSMISSION isReuseAddress Enabling this parameter prior to binding the socket allows the socket to be bound (through 'bind' method) even though a previous connection is in a timeout state. If you interested in reading more about it, please refer to Oracle's official documentation. USE WITH CAUTION !
TRANSMISSION threadPoolSize The number of threads that is assigned to process requests on the entry point
TRANSMISSION isLogPeriodicOnDebug The switch to ignore DEBUG log level for periodic tasks in JLupin Platform core components.
TRANSMISSION isDestroyThreadOnTimeout The switch that determines if the microservice destroys thread after threadExecutingTimeOut occurs. USE WITH CAUTION !
TRANSMISSION threadExecutingTimeOut This parameter is ignored, it should be set in application.properties, inside Spring Boot file
TRANSMISSION isStartOnMainServerInitialize The switch that determines if the logical service is started during Main Server startup procedure.

NOTICE that additional Spring Boot parameters are set in application.properties, located inside WAR file. These parameters (except http port, which are overridden by JLupin Platform) are loaded and used by Spring Boot as usual.

Section 'PROPERTIES'

The appropriate part of the configuration file:

[...]
PROPERTIES:
  platformVersion: '1.5.0.3'
  #jvmOptions1: '-Xms128M -Xmx256M -agentlib:jdwp=transport=dt_socket,address=12998,server=y,suspend=n'
  jvmOptions1: '-Xms64M -Xmx192M' #jvmOptions_2 - default the same as jvmOptions_1
  #jvmOptions2: '-Xms128M -Xmx256M'
  externalPort: '8000'
  version: '1.5.0.3'
  switchDelayTime: 1000
  connectionSocketTimeoutInMillis: 1000
  readTimeoutInMillis: 30000
  isKeepAlive: false
  isOOBInline: false
  isTcpNoDelay: false
  isReuseAddress: false
  sendBufferSize: 0
  receiveBufferSize: 0
  soLinger: 0
  trafficClass: 0
  #javaExecutablePath: 'c:\\jvm\\bin\\java.exe'
  #additionalClassPath: 'c:\\temp\\*'
  isStartOnMainServerInitialize: true
  priorityStartOnMainServerInitialize: 4
  waitForProcessInitResponseTimeInMillis: 90000
  waitForProcessStartResponseTimeInMillis: 90000
  waitForProcessDestroyResponseTimeInMillis: 30000
  isAllFilesToJVMAppClassLoader: true
  #isStackDumping: true
  isArchiveOnStart: false
  startLogMode: INFO
  isInitErrorCauseWithNetworkInformation: true
  isJmxEnabled: true
  jmxOptions: '-Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false'
  jmxPrimaryPort: -1
  jmxSecondaryPort: -1
  isExternalHealthcheck: false
  externalHealthcheckURI: '/isAlive'
  httpStickySessionCookieOptions: ''
  checkAvailableScript: 'function isAvailable(checkResponseTimeInMillis, jrmcActiveThreads, jrmcMaxThreads,
                                                queueActiveThreads, queueMaxThreads, servletActiveThreads, servletMaxThreads,
                                                jvmMaxMemoryInBytes, jvmTotalMemoryInBytes, jvmFreeMemoryInBytes,
                                                jvmProcessCpuLoadInPercentage, userAvailableFlag) {
                            var isAvailableByUser = Boolean(userAvailableFlag);
                            if(checkResponseTimeInMillis > 20000 || !isAvailableByUser) {
                               return false;
                            }
                            return true;
                           }'
[...]

Description:

Parameter Description
jvmOptions1 The JVM options that is used when a microservice starts
jvmOptions2 The JVM options that is used after a microservice is restarted. The default value equals to jvmOptions1
externalPort The Edge Balancer's port on which a servlet microservice will be made available (a virtual server with appropriate listen value should be configured on Edge Balancer)
version The version of a servlet microservice, this value is shown on various informational channels, such as JLupin Local Console, HTTP INFORMATION PORT, JMX etc. This parameter doesn't have any influence on the JLupin internal mechanisms.
switchDelayTime The time in milliseconds that Main Server waits after the new instance of microservice is started (in the process of microservice's restart) before the previous one is stopped. This is important parameter when health checking period of external balancer is taken into consideration.
connectionSocketTimeoutInMillis The maximum period of time in milliseconds for connection initialization from Main Server to microservice
readTimeoutInMillis The maximum period of time in milliseconds for handling request by microservice, sent by Main Server
expectedCheckResponseTimeInMillis The expected microservice response time in milliseconds in health checking process performed by Main Server
isKeepAlive It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
isOOBInline It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
isTcpNoDelay It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
isReuseAddress It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
sendBufferSize It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
receiveBufferSize It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
soLinger It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
trafficClass It's a generic parameter of a socket, created by JLupin Load Balancer (on Main Server) and used for connection to the microservice, If you would like to know more about this parameter, please refer to Oracle's official documentation. USE WITH CAUTION !
javaExecutablePath The path of JAVA binary that is used for starting the microservice. Usually this option is used when different JDK is needed for the microservice than for Main Server.
additionalClassPath Additional classpath that will be automatically added to startup command of the microservice.
isStartOnMainServerInitialize The switch that determines if the microservice should be started during Main Server startup procedure (start.cmd / start.sh).
priorityStartOnMainServerInitialize The priority for the microservice which determines the order of microservices startup during Main Server startup procedure (start.cmd / start.sh). The higher value of this parameter the later the microservice will be launched. This option gives opportunity to set the proper sequence of microservices startup where operational relations should be taken into account.
waitForProcessInitResponseTimeInMillis The time in milliseconds that Main Server waits for microservice's process initialization on the operating system level.
waitForProcessStartResponseTimeInMillis The parameter is no longer in use. It is present for backward compatibility.
waitForProcessDestroyResponseTimeInMillis The parameter is no longer in use. It is present for backward compatibility.
isAllFilesToJVMAppClassLoader An advanced setting referred to class loaders. You can try to change it only in case of ClassNotFoundException, where everything seems to be OK. In same cases external libraries use classloaders individually to load dependencies, and it turned out that sometimes they don't do it according to best practices. In such cases JVM should be set as a class loading coordinator.
isArchiveOnStart The switch determines if microservice's resources are archived in $JLUPIN_HOME/application_archive during start or restart of the microservice. This repository is for quick recovery the previous version of the microservice, for example if the new version of the microservice works incorrectly (application errors, wrong algorithms)
startLogMode The log severity of native microservice engine. The default value is 'INFO'.
isInitErrorCauseWithNetworkInformation In case of synchronous requests going through many microservices, this parameters determines if the microservice adds IP address to suppressed part of the stack, being prepared by the platform in case of exception occurs.
isJmxEnabled The switch that determines if JMX interface of a microservice is turned on (change needs restart)
jmxOptions The set of JMX parameters
jmxPrimaryPort The primary port a JMX interface (it's active after microservice startup), the value '-1' means automated port assignment performed by Main Server. The current JMX port can be taken from HTTP INFORMATION PORT, /getAllEnvironmentState.
jmxSecondaryPort The secondary port a JMX interface (it's active just after the first microservice restart), the value '-1' means automated port assignment performed by Main Server. The current JMX port can be taken from HTTP INFORMATION PORT, /getAllEnvironmentState.
isExternalHealthcheck* The switch that determines if external health checking using 'externalHealthcheckURI' sould be performed by JLupin Edge Balancer.
externalHealthcheckURI* The individual health check URI that is used for health checking process performed by JLupin Edge Balancer. The final health check URL is generated basing on the following pattern: http://<host>:<directPort>/<contextName>/<externalHealthcheckURI> and executed with GET method directly on the microserice. If the parameters is empty the default value from Edge Balancer configuration is used ('healthcheckDefaultURI').
httpStickySessionCookieOptions* Additional set of JLupin Edge Balancer persistent cookie options which is automatically added if 'httpStickySession' is set to 'true'. If it's empty the default value from Edge Balancer configuration is used ('balancerCookieOptions').
checkAvailableScript The function written in Java Script, used by JLupin Load Balancer on Main Server to determine under what conditions this particular microservice should be set as unavailable.

* since 1.5.0.3

Section 'INITIALIZING_LOGGER'

The appropriate part of the configuration file:

[...]
INITIALIZING_LOGGER:
  #directoryPath: '/logs/server'
  #fileName: 'file_name'
  fileExtension: 'log'
  fileSizeInMB: 20
  maxFiles: 10
[...]

Description:

Parameter Description
directoryPath The alternative directory for microservice's logs. The default is $JLUPIN_HOME/logs.
fileName The prefix of the microservice log file.
fileExtension The extension of microservice log file.
fileSizeInMB The maximum log file size, expressed in MB.
maxFiles The maximum number of files. If the limit is exceeded, the first file is used again.

Section 'MEMORY_ERRORS'

The appropriate part of the configuration file:

[...]
MEMORY_ERRORS:
  isRestartOnError: true
  howManyTimes: 4
  percentageGrowth: 15
  isHeapDump: true
[...]

Description:

Parameter Description
isRestartOnError Determines if the microservice is restarted in case of OutOfMemoryError or StackOverFlow occurs.
howManyTimes Number of restart iterations if the memory errors still occur.
percentageGrowth Specifies how many percent of the heap will be increased in case of the restart.
isHeapDump Determines if the heap dump is performed in case of OutOfMemoryError.

Section 'THREAD_POOLS'

This section contains definitions of additional thread pools which could be used in the microservice. Each subsection is a separate thread pool definition, the name of subsection is the name of thread pool.

The appropriate part of the configuration file:

[...]
THREAD_POOLS:
  THREAD_POOL_1:
    size: 8
    waitingTimeForTasksCompletionInMillis: 10000
Parameter Description
size The number of threads in the pool. If it equals 0, the pool is not initialized.
waitingTimeForTasksCompletionInMillis The period of time that Main Server waits for threads to be inactive in shutdown procedure.


Default configuration file

SERVERS:
  HTTP:
    type: spring_boot
    httpPrimaryPort: -1
    httpSecondaryPort: -1
    waitForFinishExecuteAllRequests: true
    waitToShutdownThreadsOnStop: 5000
    springBootLoaderClassName: org.springframework.boot.loader.WarLauncher
    contextName: /exchange
    isStartOnMainServerInitialize: true
    httpStickySession: false
  TRANSMISSION:
    readTimeout: 480000
    isWaitForFinishExecuteAllRequests: false
    waitToShutdownThreadsOnStop: 60000
    backlog: 0
    receiveBufferSize: 0
    isReuseAddress: false
    threadPoolSize: 8
    isLogPeriodicOnDebug: true
    isDestroyThreadOnTimeout: false
    threadExecutingTimeOut: 3600000
    isStartOnMainServerInitialize: true
PROPERTIES:
  platformVersion: '1.5.0.3'
  #jvmOptions1: '-Xms128M -Xmx256M -agentlib:jdwp=transport=dt_socket,address=12998,server=y,suspend=n'
  jvmOptions1: '-Xms64M -Xmx192M' #jvmOptions_2 - default the same as jvmOptions_1
  #jvmOptions2: '-Xms128M -Xmx256M'
  externalPort: '8000'
  version: '1.5.0.3'
  switchDelayTime: 1000
  connectionSocketTimeoutInMillis: 1000
  readTimeoutInMillis: 30000
  isKeepAlive: false
  isOOBInline: false
  isTcpNoDelay: false
  isReuseAddress: false
  sendBufferSize: 0
  receiveBufferSize: 0
  soLinger: 0
  trafficClass: 0
  #javaExecutablePath: 'c:\\jvm\\bin\\java.exe'
  #additionalClassPath: 'c:\\temp\\*'
  isStartOnMainServerInitialize: true
  priorityStartOnMainServerInitialize: 4
  waitForProcessInitResponseTimeInMillis: 90000
  waitForProcessStartResponseTimeInMillis: 90000
  waitForProcessDestroyResponseTimeInMillis: 30000
  isAllFilesToJVMAppClassLoader: true
  #isStackDumping: true
  isArchiveOnStart: false
  startLogMode: INFO
  isInitErrorCauseWithNetworkInformation: true
  isJmxEnabled: true
  jmxOptions: '-Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false'
  jmxPrimaryPort: -1
  jmxSecondaryPort: -1
  isExternalHealthcheck: false
  externalHealthcheckURI: '/isAlive'
  httpStickySessionCookieOptions: ''
  checkAvailableScript: 'function isAvailable(checkResponseTimeInMillis, jrmcActiveThreads, jrmcMaxThreads,
                                                queueActiveThreads, queueMaxThreads, servletActiveThreads, servletMaxThreads,
                                                jvmMaxMemoryInBytes, jvmTotalMemoryInBytes, jvmFreeMemoryInBytes,
                                                jvmProcessCpuLoadInPercentage, userAvailableFlag) {
                            var isAvailableByUser = Boolean(userAvailableFlag);
                            if(checkResponseTimeInMillis > 20000 || !isAvailableByUser) {
                               return false;
                            }
                            return true;
                           }'
INITIALIZING_LOGGER:
  #directoryPath: '/logs/server'
  #fileName: 'file_name'
  fileExtension: 'log'
  fileSizeInMB: 20
  maxFiles: 10
MEMORY_ERRORS:
  isRestartOnError: true
  howManyTimes: 4
  percentageGrowth: 15
  isHeapDump: true
THREAD_POOLS:
  THREAD_POOL_1:
    size: 8
    waitingTimeForTasksCompletionInMillis: 10000
  #THREAD_POOL_2:
  #  size: 8
  #  waitingTimeForTasksCompletionInMillis: 10000