Win a copy of Rust Web Development this week in the Other Languages 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Microservices with SpringBoot migration

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to implement a microservice architecture starting from my monolithic architecture. the current implementation is composed by a certain number of executable jars called using a list of options (some mandatory and others optional); I was thinking to convert each of them in a service.  The idea is to build a sort of wrapper around of the current jar using springboot, adding one controller with a sort of start/stop to be called from outside for implementing the REST API interface , anyway it is not clear to me which is the best way, for an external app (or another service), to pass the list of options (I can pass a string or var=value structure but it looks heavy with many options). Can someone tell me which is the best way to do this migration, or if the idea to build a wrapper is wrong. Thanks a lot for the help.
 
Saloon Keeper
Posts: 24812
172
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Spring Boot doesn't a microservice make. In fact, you can bundle some distinctly non-micro services into Spring Boot. Spring Boot is just a convenient all-in-one bundling of a webapp server (e.g., Tomcat) with a webapp so that instead of the usual fuss about installing a webapp server and deploying an app into it, you have an all-in-one module.

However, Spring Boot and Containers are both (and often used together) handy ways of packaging up micro-services for quick and easy deployment.

If you have executable JARs and want to use them via ReST, the first step is then to build webapps based on them. Whether those webapps end up as micro-services of full-blown apps would depend on what your JARs contain.

The preferred way for a Tomcat server to provide custom options to a webapp is to set them up in webapp environment options as part of the deployment of the webapp so that JNDI code within the webapp can find and read them. I've not actually read up on how that would translate into Spring Boot, but I'd expect that the "-D" JVM command line options play a part.
 
takaya treschi
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot for the answer and you are right when you say springboot doesn't make microservices......anyway the idea is to convert a monolithic application composed by 7-8 executables (and a lot of shared libraries) in a system based on 7-8 services (each executable independent). So I thought the best way was to make for each executable (jar app) a standalone service called from a sort of MMI (orchestrator to use the microservice notation). Anyway in order to be able to start/stop the app I decided to wrap my original app in a springbootapp with web REST/API enabled (tomcat encapsulated). At this point it is clear I can call the old executable via web using the parameters needed for example the old:

java -jar target/foo.jar -i abc                                                                                      
Missing required option: o
usage: utility-name
-i,--input <arg>    input file path
-o,--output <arg>   output file

in the simple case and after defined the controller:
http://localhost/foo?input=aaa&output=bbb

But what to do when the number of app options is high? Is there another way to perform the migration?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic