Running a Microservice
Last updated: 9/30/2026After building a Job or Route as a Microservice, you can run it independently of Talend Studio in standalone mode. You can also run a SOAP Service built as a Microservice from its fat .jar file.
To configure the default application properties for Microservices built from a project, edit the setting at . The file applies to every Microservice built from the project. The preference key for this setting is ms_standalone_application_properties.
To run a Microservice .jar file, proceed as follows in a console window:
-
Change to the directory where the Microservice .jar file is located.
-
Type in the following command.
java -jar <ArchiveFileName> --context=<context_environment_name> --configuration.additional-location=<configuration_file_path> --<context_parameter_name>=<context_parameter_value>
By default, when running a Microservice, it calls the configuration files in the /config folder inside the Microservice Jar. You can switch to an external configuration folder where the configuration files are located using the configuration.additional-location property.
For example, the following command executes the Microservice DemoREST_0.1.jar using the configuration in the custom.properties file in the directory where the Microservice Jar is located.
java -jar DemoREST_0.1.jar --configuration.additional-location=./custom.propertiesThe following parameters can be configured in the properties file, for example:
# ============================================================================
# Microservice runtime configuration (application.properties)
#
# Applicability of each parameter:
# [ALL] - applies to all microservices (REST and SOAP)
# [REST] - applies to REST microservices only
# [SOAP] - applies to SOAP microservices only
# ============================================================================
# [ALL] Location of the startup banner printed in the console.
banner.location=classpath:/config/banner.txt
# --- Embedded HTTP server (Jetty) -------------------------------------------
# [ALL] Protocol (http/https), bind address and listen port of the server.
server.protocol=http
# keep it as 0.0.0.0 for docker container
server.host=0.0.0.0
server.port=8065
# [ALL] Base context path the CXF servlet is mounted on. Both REST (JAX-RS) and
# SOAP (JAX-WS) endpoints are published below this path, e.g.
# http://<host>:<port>/services/<endpoint>.
server.servlet.context-path=/services
# [ALL] Location of the logging (log4j2) configuration file.
logging.config=classpath:config/log4j2.xml
# --- Management / monitoring ------------------------------------------------
# [ALL] Base path and the actuator endpoints exposed for monitoring
# (health, info, metrics, ...).
management.server.base-path=/
management.endpoints.web.exposure.include=info,health,jolokia,prometheus
# [ALL] Expose Java runtime information on the info endpoint.
management.info.java.enabled=true
# [ALL] Default credentials protecting the management endpoints. The same
# credentials are reused for SOAP service security, so SOAP microservices do
# not need their own credentials.
security.user.name=${MS_SECURITY_USER_NAME:#{null}}
security.user.password=${MS_SECURITY_USER_PASSWORD:#{null}}
# [ALL] SSL configuration (disabled by default).
#security.require-ssl=false
#server.ssl.key-store=dispatchJob/src/main/resources/config/keystore.jks
#server.ssl.key-store-type=JKS
#server.ssl.key-store-password=sspass
#server.ssl.key-store-alias=servicekey
#server.ssl.client-auth=need
# [ALL] SSL truststore configuration (disabled by default).
#server.ssl.trust-store=server-truststore.jks
#server.ssl.trust-store-password=password
#server.ssl.trust-store-type=JKS
# [ALL] Embedded Jetty thread pool sizing.
jetty.threadPool.maxThreads=200
jetty.threadPool.minThreads=8
#jetty.threadPool.threadNamePrefix=JettyThread
# [ALL] Server access (request) log settings (disabled by default).
#server.requestlog.enabled=false
#server.requestlog.append=true
#server.requestlog.file=request.log
#server.requestlog.retaindays=1
#server.requestlog.format=%{client}a - %u %t "%r" %s %O "%{Referer}i" "%{User-Agent}i"
# --- SOAP (JAX-WS) specific -------------------------------------------------
# [SOAP] Parameters below are reserved for SOAP microservices. They share the
# same HTTP server and base path as REST (server.servlet.context-path above);
# SOAP endpoints are published as <context-path>/<service>?wsdl. SOAP service
# security reuses the shared security.user.* credentials defined above. The
# entries are documented for the SOAP microservice build and are commented out
# (no effect until the build consumes them).
# [SOAP] Publish the WSDL and the CXF service-list page under the base path.
#soap.wsdl.publish=true
#soap.service-list.hide=falseMoreover, you can use the management.endpoints.secured=true/false parameter to activate or deactivate basic authentication for health and info endpoints, which has no impact on the basic authentication for jolokia endpoint.
For Route Microservices:
-
http://localhost:8065/health can be used to get the status of Microservice liveness checks including default checks and custom checks. Camel context is always the default check.
-
http://localhost:8065/ready can be used to get the status of Microservice readiness checks including default checks and custom checks. Every flow in a Route has a readiness checker by default.
info.app.encoding=UTF-8
info.app.java.source=17
info.app.java.target=17You can use the management.endpoint.prometheus.enabled=true/false parameter to activate or deactivate the Prometheus endpoint for the Microservice.
security.enabled=[true/false]
security.type=[BASIC/JWT]
security.jwt.keystore.type=[JKS/PKCS12/JWKS]
security.jwt.keystore.url=
security.jwt.keystore.file=
security.jwt.keystore.password=
security.jwt.keystore.alias=
security.jwt.audience=The security configuration for BASIC and JWT Bearer Token types and Prometheus endpoint activation in the properties file can be overwritten by using the relevant parameter in Commandline when running the Microservice.
Any context parameter in the Microservice configuration (application.properties) can be overridden. Here is the priority order of the context parameters, the latter overriding the former:
- Default context from the Microservice archive.
- --context=<context_environment_name>
- --config.additional-location=anyFile1,anyFile2
- anyFile1
- anyFile2
- --ctxParamName=ctxParamValue --ctxParamName=ctxOtherParamValue
--ctxParam2Name=ctxParam2Value
In this example, the second ctxParamName parameter overrides the first one. The result would be:
ctxParamName=ctxOtherParamValue and ctxParam2Name=ctxParam2Value
To run a Microservice as a .zip file, proceed as follows:
-
Extract the .zip file in the directory of your choice.
-
Go to the <ArchiveFileName> folder that contains the external config folder, the Microservice .jar file, and the start scripts to start the Microservice for Linux (.sh) and Windows (.bat).
-
Edit the configuration files in the config folder as needed and run the .sh file on Linux or the .bat file on Windows to start the Microservice with the external configurations.