Posts

Setup ActiveMQ Artemis on Windows 10

Image
ActiveMQ Artemis is an open source project for asynchronous messaging system. It is faster, more recent implementation, including support for JMS 2.0.  Artemis is the codename used for the HornetQ code that was donated to the Apache Foundation. Let us start Atremis setup on Windows machine. Step 1: Download and extract the archive In this tutorial, I've downloaded version 2.17.0 zip file using below link: https://www.apache.org/dyn/closer.cgi?filename=activemq/activemq-artemis/2.17.0/apache-artemis-2.17.0-bin.zip&action=download Once downloaded, extract it to some convenient location. e.g.: D:\apache-artemis-2.17.0 Step 2: Run the ActiveMQ Artemis Note. Artemis only runs on Java 7 or later. Open command prompt and navigate to ${ARTEMIS_HOME}/bin Create a Broker Instance using command:  ${ARTEMIS_HOME}/bin/artemis create mybroker A broker instance is the directory containing all the configuration and runtime data, such as logs and data files. Start your Br

Performance Monitoring of Java Classes with Spring AOP

Method performance monitoring is a trivial task and with Spring AOP it doesn't require any code change, just some simple configurations.  But unfortunately is not very useful on its own as it provide response time only and doesn't provide any other stats. One easy way to have some useful stats is to write a simple interceptor class instead of using Spring default one ( PerformanceMonitorInterceptor ).  Below is an example of this that provides periodic stats (last, average and greatest response time) as well as warning whenever a method response time exceeds a configured threshold. package com.myapp.web.interceptor; import java.util.concurrent.ConcurrentHashMap; import org.aopalliance.intercept.MethodInterceptor; import org.aopalliance.intercept.MethodInvocation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class CustomPerformanceInterceptor implements MethodInterceptor {     Logger logger = LoggerFactory. getLogger (