LMAX Spring Integration Java Example

LMAX Spring Integration Java Example

LMAX is High Performance Inter-Thread Messaging Library which can be use to any application where process of many trades needs low latency. Please read Martin Fowler blog about LMAX architecture and github code for its library.

You could also refer Getting started tutorial example to understand how it can be use.

In this tutorial you will see how to integrate this library with Spring framework. We will create Maven project LMAXSpringIntegration below is its structure:

Tools needed:

  • JDK1.8
  • Eclipse (Any latest version)
  • LMAX jars

pom.xml:

  • log4j2.xml:

  • javahonk.properties:

  • javahonk-context.xml:

  • DisruptorPoolExceptionHandler.java:

  • JavaHonkMessage.java:

  • MessageEvent.java:

  • MessageManager.java:

  • MessageProcessor.java:

  • LMAXSpringTest.java: Main test program which will start application and send one sample message:

  • To run this example right click LMAXSpringTest.java –> Run As –> Java Application you will see below message printed on screen:

Note: Please don’t forget to setup VM argument:

-Denvironment.target=DEV –> This set environment and you could change accordingly
-Dlogging.dir=./ –> It sets logging directory path

Leave a Reply

Your email address will not be published. Required fields are marked *