Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Running a messaging engine (command line application) inside spring boot

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm fairly new to Spring Boot, and would like to get some information to allow me to best handle running an application inside the Spring container.

Basically, I have a FIX engine (accepts and sends FIX messages). I could have this as a standalone java application (client-server), but I decided to go for Spring because I'm leveraging its ease of use for hibernate + dependency injection. I will also have to eventually implement a front-end so that will be easy to setup with Spring.

What I'm currently doing is running my engine via the CommandLineRunner. That initiates everything I need (sockets and all), and listens for incoming messages. Once I get the LOGOFF message, I exit my application gracefully (System.exit(0) with a ShutdownHook -- though another option would also be to have the engine be on 24/7).

My question is if I'm using the Spring container properly, or if there's a better way? For example, should I be decoupling the Spring application from the engine itself? Most things I see on the internet about CommandLineRunner is they allow you to run a piece of code to initialize something before your main application starts, but I'm full on running an entire FIX engine. Maybe there's something I'm missing about the relationship between a Spring container and its underlying application.

Any help greatly appreciated, this will be the first time I push something this big in production. Also, I've posted the same question over on StackOverflow. So you can answer on both forums if you want rep there too (hope this isn't against this forum's rules).

look! it's a bird! it's a plane! It's .... a teeny tiny ad
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic