WSO2: Running the Micro Integrator as a Windows Service

WSO2: Running the Micro Integrator as a Windows Service

Follow the instructions given below to run the Micro Integrator as a Windows service.

Navigate product page,or click on “https://wso2.com/micro-integrator/” Download, and then click Zip Archive to download the product distribution as a ZIP file.

Extract the downloaded ZIP file to a location on your computer. The micro-integrator folder inside the extracted ZIP file will be your MI_HOME directory.

Set MI_HOME Environment Variable:

  • click on the system environment Variables.
  • In that click on environment Variable in the Environment Variables window, under “System variables”, click “New”.
  • Enter the variable name “wso2mi_home” and variable value “D:\wso2mi-4.2.0” >> click  ok

Setting up the YAJSW Wrapper Exact the file, click on <yajsw-home>\conf \wrapper.conf

In wrapper.conf fileReplace the below content

# Tested with open jdk 11.05 & yajsw-stable-12.14

#********************************************************************

# working directory

#********************************************************************

wrapper.working.dir=${wso2mi_home}\\

# Java Main class.

# YAJSW: default is “org.rzo.yajsw.app.WrapperJVMMain”

# DO NOT SET THIS PROPERTY UNLESS YOU HAVE YOUR OWN IMPLEMENTATION

# wrapper.java.mainclass=

#********************************************************************

# tmp folder

# yajsw creates temporary files named in_.. out_.. err_.. jna..

# per default these are placed in jna.tmpdir.

# jna.tmpdir is set in setenv batch file to <yajsw>/tmp

#********************************************************************

wrapper.tmp.path = ${jna_tmpdir}

#********************************************************************

# Application main class or native executable

# One of the following properties MUST be defined

#********************************************************************

# Java Application main class

wrapper.java.app.mainclass=org.wso2.micro.integrator.bootstrap.Bootstrap

# Log Level for console output.  (See docs for log levels)

wrapper.console.loglevel=INFO

# Log file to use for wrapper output logging.

wrapper.logfile=${wrapper_home}\/log\/wrapper.log

# Format of output for the log file.  (See docs for formats)

#wrapper.logfile.format=LPTM

# Log Level for log file output.  (See docs for log levels)

#wrapper.logfile.loglevel=INFO

# Maximum size that the log file will be allowed to grow to before

#  the log is rolled. Size is specified in bytes.  The default value

#  of 0, disables log rolling by size.  May abbreviate with the ‘k’ (kB) or

#  ‘m’ (mB) suffix.  For example: 10m = 10 megabytes.

# If wrapper.logfile does not contain the string ROLLNUM it will be automatically added as suffix of the file name

wrapper.logfile.maxsize=10m

# Maximum number of rolled log files which will be allowed before old

#  files are deleted.  The default value of 0 implies no limit.

wrapper.logfile.maxfiles=10

# Title to use when running as a console

wrapper.console.title=”WSO2 Micro Integrator”

#********************************************************************

# Wrapper Windows Service and Posix Daemon Properties

#********************************************************************

# Name of the service

wrapper.ntservice.name=WSO2MI

# Display name of the service

wrapper.ntservice.displayname=WSO2 Micro Integrator 4.2.0

# Description of the service

wrapper.ntservice.description=Provides the ability to run WSO2 Micro Integrator 4.2.0 as a Windows Service

#********************************************************************

# Wrapper System Tray Properties

#********************************************************************

# enable system tray

wrapper.tray = true

# TCP/IP port. If none is defined multicast discovery is used to find the port

# Set the port in case multicast is not possible.

wrapper.tray.port = 15002

#********************************************************************

# Exit Code Properties

# Restart on non zero exit code

#********************************************************************

wrapper.on_exit.0=SHUTDOWN

wrapper.on_exit.default=RESTART

#********************************************************************

# Trigger actions on console output

#********************************************************************

# On Exception show message in system tray

wrapper.filter.trigger.0=Exception

wrapper.filter.script.0=${wrapper_home}/scripts/trayMessage.gv

wrapper.filter.script.0.args=Exception

#********************************************************************

# genConfig: further Properties generated by genConfig

#********************************************************************

placeHolderSoGenPropsComeHere=

#wrapper.java.command = java

wrapper.java.command = ${java_home}/bin/java

wrapper.java.classpath.1 = ${wso2mi_home}\\bin\\*.jar

wrapper.java.classpath.2 = ${wso2mi_home}\\wso2\\lib\\*.jar

wrapper.app.parameter.1 = org.wso2.micro.integrator.bootstrap.Bootstrap

wrapper.app.parameter.2 = RUN

wrapper.java.additional.1 = -Xms256m

wrapper.java.additional.2 = -Xmx1024m

wrapper.java.additional.3 = -XX:+HeapDumpOnOutOfMemoryError

wrapper.java.additional.4 = -XX:HeapDumpPath=${wso2mi_home}\\repository\\logs\\heap-dump.hprof

wrapper.java.additional.5 = -Dcom.sun.management.jmxremote

wrapper.java.additional.6 = -Dcarbon.registry.root=\/

wrapper.java.additional.7 = -Dcarbon.home=${wso2mi_home}

wrapper.java.additional.8 = -Dwso2.server.standalone=true

wrapper.java.additional.9 = -Djava.command= java

wrapper.java.additional.10 = -Djava.io.tmpdir=${wso2mi_home}\\wso2\\tmp

wrapper.java.additional.11 = -Dcarbon.config.dir.path=${wso2mi_home}\\conf

wrapper.java.additional.12 = -Dcarbon.logs.path=${wso2mi_home}\\repository\\logs

wrapper.java.additional.13 = -Dcomponents.repo=${wso2mi_home}\\wso2\\components\\plugins

wrapper.java.additional.14 = -Dconf.location=${wso2mi_home}\\conf

wrapper.java.additional.15 = -Dcom.atomikos.icatch.hide_init_file_path=true

wrapper.java.additional.16 = -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

wrapper.java.additional.17 = -Dcom.sun.jndi.ldap.connect.pool.authentication=simple

wrapper.java.additional.18 = -Dcom.sun.jndi.ldap.connect.pool.timeout=3000

wrapper.java.additional.19 = -Dorg.terracotta.quartz.skipUpdateCheck=true

wrapper.java.additional.20 = -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false

wrapper.java.additional.21 = -Dfile.encoding=UTF8

wrapper.java.additional.22 = -DworkerNode=false

wrapper.java.additional.23 = -Dorg.wso2.ignoreHostnameVerification=true

wrapper.java.additional.24 = -Dcarbon.components.dir.path=${wso2mi_home}\\wso2\\components

wrapper.java.additional.25 = -Dcarbon.extensions.dir.path=${wso2mi_home}\\wso2\\components\\extensions

wrapper.java.additional.26 = -Dcarbon.dropins.dir.path=${wso2mi_home}\\dropins

wrapper.java.additional.27 = -Dcarbon.external.lib.dir.path=${wso2mi_home}\\lib

wrapper.java.additional.28 = -Dcarbon.patches.dir.path=${wso2mi_home}\\patches

wrapper.java.additional.29 = -Dcarbon.servicepacks.dir.path=${wso2mi_home}\\servicepacks

wrapper.java.additional.30 = -Dcarbon.internal.lib.dir.path=${wso2mi_home}\\wso2\\lib

wrapper.java.additional.31 = -Dprofile=micro-integrator-default

wrapper.java.additional.32 = -Dei.extendedURIBasedDispatcher=org.wso2.micro.integrator.core.handlers.IntegratorStatefulHandler

wrapper.java.additional.33 = -DNonRegistryMode=true

wrapper.java.additional.34 = -DNonUserCoreMode=true

wrapper.java.additional.35 = -DavoidConfigHashRead=true

wrapper.java.additional.36 = -Dproperties.file.path=default

wrapper.java.additional.37 = -DenableReadinessProbe=true

wrapper.java.additional.38 = -DenableManagementApi=true

wrapper.java.additional.39 = -Dorg.apache.activemq.SERIALIZABLE_PACKAGES=”*”

wrapper.java.additional.40 = -Djava.util.logging.config.file=${wso2mi_home}\\conf\\etc\\logging-bridge.properties

wrapper.java.additional.41 = -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager

wrapper.java.additional.42 = -Dserver.main.class=org.wso2.carbon.micro.integrator.server.Main

wrapper.java.additional.43 = -DskipStartupExtensions=false

wrapper.java.additional.44 = -Dlogfiles.home=${wso2mi_home}\\repository\\logs

wrapper.java.additional.45 = -DenableLivenessProbe=true

wrapper.java.additional.46 = –add-opens=java.base/java.lang=ALL-UNNAMED

wrapper.java.additional.47 = –add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED

wrapper.java.additional.48 = –add-opens=java.base/java.net=ALL-UNNAMED

Search for Environment Variables then select Edit the system environment variables.

Click the Environment Variables button.

Under System Variables, click New.

In the Variable Name field Java_home

In the Variable Value field, enter your JDK or JRE installation path.

Click OK and Apply Changes as prompted.

Navigate to the <yajsw-home>\bat directory, open a terminal

Installing the service:

installService.bat

Click on Services >> Open.

You view the WSO2 Micro Integrator service added to the list of Windows services as shown below.

Starting the service

Navigate to the <YAJSW_HOME>/bat/ directory in the Windows command prompt with administrative privileges and execute the following command.

When you start the service, we can use this command also “StartService.bat”

The console will display a message confirming that the service has started.

Stopping the service

Navigate to the <YAJSW_HOME>/bat/ directory in the Windows command prompt with administrative privileges, and execute the following command:stopService.bat

The console will display a message confirming that the service was stopped.

Uninstalling the service 

To uninstall the service, navigate to the <YAJSW_HOME>/bat/ directory in the Windows command prompt with administrative privileges, and execute the following command: uninstallService.bat

The console will display a message confirming that the service was uninstalled. For more information, please visit [email protected].