This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go 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
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

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

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).

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!