Tanuki Wrapper and SAP Hybris

Hybris Logo

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…

Tanuki wrapper and SAP Hybris

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 load wrapper-debug.conf)
  • catalina.sh calls ./wrapper.sh start
  • wrapper.sh start the JVM using the Java executable configured within wrapper.java.command, then runs the main class configured within the property wrapper.java.mainclass -> org.tanukisoftware.wrapper.WrapperSimpleApp
  • WrapperSimpleApp bootstrap Catalina using org.apache.catalina.startup.Bootstrap, which is configured within the property wrapper.app.parameter.1
  • And finally Catalina/Tomcat runs Hybris Webapp

This is a simplified workflow of how all this is working :

Tanuki and Hybris worklow

 

Happy reading 🙂

 

5 1 vote
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x