Posts

Showing posts with the label spring-boot

Remote JVM monitoring using VisualVM

Image
Most of the modern JVM application frameworks like Spring Boot, Dropwizard and Ktor uses executable jars to bootstrap application with servers embedded inside the jar. The following steps will allow you to monitor the remote JVM running in cloud (or in house data center) using SSH port forwarding and Java JMX. In order to monitor the remote JVM, the java process needs to be started with extra system properties to enable JMX features and you should be able to SSH into the machine where the JVM is running. Start the Java application (or Java Process) with JMX enabled as given below: java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10006 -Dcom.sun.management.jmxremote.rmi.port=10006 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=localhost -jar spring-boot-application.jar Create a SSH tunnel with port forwarding for JMX port ssh -L 10006...

Essential Heroku Commands for Java (Spring Boot) developers

This blog post captures the command used to create and configure java apps or spring boot apps deployed to Heroku Cloud. I use these commands in CI/CD deployment steps for continuous delivery and also to access the application's information from my local development machine. These commands are tested with Heroku Client version: heroku/7.0.33 darwin-x64 node-v10.0.0 View help heroku help Login/Logout to heroku With email and password heroku auth:login heroku auth:whoami heroku auth:logout Login/Logout to heroku With token # set HEROKU_API_KEY environment variable to login export HEROKU_API_KEY=<<API Key from https://dashboard.heroku.com/account>> heroku auth:whoami # unset HEROKU_API_KEY environment variable to logout unset HEROKU_API_KEY # clear the history to clear the API Key history -cw && cat /dev/null > ~/.bash_history Show available regions for deployment heroku regions Create an application heroku apps:create --app app-...

Feature Toggle Integration Testing with Spring Boot

This blog explains tries to explain the following concepts: What is a feature toggle? Use case of feature toggle in real life Importance of integration testing with feature on and off What is a feature toggle? The mechanism of controlling the application's behaviour or feature during runtime using an external configuration or property is called feature toggle. Use case of feature toggle in real life Imagine you are a developer working for a telecom provider. Every time a new product or phone is launched by manufacturers, the products should not be displayed in the telecom provider's website, until it is officially launched by the manufacturers like Apple or Google. However as a telecom provider, your organisation should be able to sell or receive orders for the newly launched phones, immediately after the launch of the new phones. Hence, feature toggle becomes quite handy, where the application can be developed with new features targeting the sales of un-lau...