Tanuki Wrapper and SAP Hybris
What is Tanuki wrapper ?
Tanuki Wrapper is a Java service wrapper, — far from commercial speech — it is an application that allows Hybris to run as Windows service or UNIX daemon, and it coms with some additional functionality to monitor the JVM, logging to console output config JVM, or generating thread dump…
How it works ?
Tanuki wrapper has two important files :
- wrapper.conf : contains Tanuki properties to config the wrapper, exemple :
wrapper.java.command
: the path to Java executable
wrapper.java.mainclass
: the main class to be run when the wrapper starts the JVM
wrapper.app.parameter.1
: contains the bootstrap class, to start Catalina/Tomcat
wrapper.port.min
: it’s the lower limit of the port range that the JVM will use to connect back to the Wrapper
wrapper.port.max
: it’s the higher limit of the port range that the JVM will use to connect back to the Wrapper
wrapper.console.format
: to configure the format of outputs logging to the console
wrapper.console.loglevel
: to configure the log levels to be sent to the console
- wrapper.sh : is the main script to start, stop, install Hybris service/daemon, generate dump…
./wrapper.sh console
: to start Hybris in console mode
./wrapper.sh start
: start Hybris as a daemon
./wrapper.sh stop
: stop Hybris daemon
./wrapper.sh status
: status of Hybris (running, stopped)
./wrapper.sh install
: install Hybris daemon
./wrapper.sh remove
: uninstall Hybris daemon
./wrapper.sh dump
: generate threaddumps using kill -3
signal
How does exactly work ?
- When we start Hybris using
./hybrisserver.sh start
- It load
tomcat/conf/wrapper.conf
and run the command./catalina.sh run
(in case of debug it loadwrapper-debug.conf
) - catalina.sh calls ./wrapper.sh start
wrapper.sh
start the JVM using the Java executable configured withinwrapper.java.command
, then runs the main class configured within the propertywrapper.java.mainclass
->org.tanukisoftware.wrapper.WrapperSimpleApp
WrapperSimpleApp
bootstrap Catalina usingorg.apache.catalina.startup.Bootstrap
, which is configured within the propertywrapper.app.parameter.1
- And finally Catalina/Tomcat runs Hybris Webapp
This is a simplified workflow of how all this is working :
Happy reading 🙂
Software Craftsmanship, Stackextend author and Full Stack developer with 6+ years of experience in Java/Kotlin, Java EE, Angular and Hybris…
I’m Passionate about Microservice architectures, Hexagonal architecture, Event Driven architecture, Event Sourcing and Domain Driven design (DDD)…
Huge fan of Clean Code school, SOLID, GRASP principles, Design Patterns, TDD and BDD.