Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Can I have some directions about my simple REST-HTTP server, please?

 
Greenhorn
Posts: 22
Python Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The context is that we have some complex system that does only API calls but sometimes we need to do other things, such as connect to a database and do some SELECT, etc...
(we cannot extend/modify that system)
My idea, which so far seems the most popular, is to create an auxiliary REST-HTTP server and then have our system call it (and that server will perform the non-api stuff).

However, I don't know what Java technologies to mix and match in order to build what I need.

Let me show how I imagine that application and maybe you could tell me what kind of stuff to look into:

1. User downloads the classes (has JDK-8 and JDK-11 already)
2. They come in a folder like so:
   AuxServer
   ├── config.json
   ├── AuxServer.class
   ├── MoreClassesIfNeeded.class
   ├── log.txt
   └── startAuxServer.bat

filepurpose
config.jsonHas parameters for starting the server. For example: the port that the server is going to listen to
AuxServer.classPrecompiled java class that contains the server logic (I will make building this distributable later. For now, I just want people to get on with their task)
log.txtEvery server operation, data and result are logged in here for debugging (it's OK, nothing secure is being transferred)
startAuxServer.batMakes running the server a one-click affair

3. User runs startAuxServer.bat to start the server and a console shows up (console is basically a live version of the log.txt)
4. User then triggers the API system and that system will call the AuxServer when it needs to, making REST-HTTP calls on the agreed port
5. User somehow shuts down AuxServer, such that the system on which the server was running does not become screwed up (memory released, port made free, etc...)

My design goal is to be super-minimalistic in terms of avoiding unnecessary project elements. Especially things that need to be installed other than a JRE.
The reason for that is that I am not a Java expert and it will be hard for me to learn (but I do insist to thoroughly understand all the parts of things that I make available
for general use!) and I will actually have to teach a few team members who are even less familiar with Java then me!

So, anything like technologies I will need (Spring?) or how to shape that project will be appreciated!
I would be surprised if there isn't already some example project like this (but I don't know what to search for). So, if you know something, please mention.

Many thanks!
 
Todor Kolev
Greenhorn
Posts: 22
Python Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry to bump this but any help would be greatly appreciated! I am hoping to get started over the weekend.
Any word I can google in the right direction or maybe I am in the wrong section?
Or maybe you can suggest another place to look for help?

Thanks again
 
Marshal
Posts: 14046
234
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Todor Kolev wrote:
My design goal is to be super-minimalistic in terms of avoiding unnecessary project elements. Especially things that need to be installed other than a JRE.
The reason for that is that I am not a Java expert and it will be hard for me to learn (but I do insist to thoroughly understand all the parts of things that I make available
for general use!) and I will actually have to teach a few team members who are even less familiar with Java then me!


This is your biggest impediment. What you described prior to the above is a non-trivial system, which practically makes your goal of being "super-minimalistic" a non-starter.

The best advice I can give you is to start with technologies like Spring Boot that provide a lot of plumbing already and are relatively opinionated about the architecture. That is, it provides a framework that allows you to focus more on the custom logic related to your problem domain rather than all the infrastructure plumbing. There's still some of the latter but it's mostly abstracted away. But again, your problem is non-trivial and therefore, so will your solution.
 
Todor Kolev
Greenhorn
Posts: 22
Python Java Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is excellent, thank you!
I love this whole concept of "opinionated instance" - a pretty-well-thought-out model is something that I can subscribe to and feel confident to rely upon. It helps me to ignore the possibility that what I am doing may not be perfect.
It's part of my disability that prevented me from listening in school or doing anything constructive.
Basically, if no one put any limits on me, then I would buy lots of transistors and start there. Not saying I'd be good at that, just this will be my mindset!

I will have tons of fun this weekend!

I will post my project here and how to get started, for people who might stumble upon this thread.
 
He was expelled for perverse baking experiments. This tiny ad is a model student:
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!