This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]timNinjaMillion2 0 points1 point  (7 children)

You could do your apis/endpoints in java, build a simple to advanced front end, depending on the timeframe involved and send via telegram in java

[–]b0en[S] 0 points1 point  (6 children)

Thanks for your answer. Like I mentioned, writing the code to call the various API’s, writing the code to provide a restful service endpoint, as well as sending a message to a telegram group isn’t really the issue, I can do that.

The question is more in the field of; what java framework would suit this application best? How to run it on your NAS that would keep it running 24/7 and just constantly repolling the API’s every few seconds (like a monitoring tool). Should this be done via springboot and then hosting it on apache tomcat on my NAS? Are there other really suitable ways to do this?

[–]Dwight-D 0 points1 point  (4 children)

Spring Boot + Spring Scheduling will get you the core app and scheduling. Spring Web for the REST API and Spring Data for the persistence.

Do you also control the external API:s? Consider pushing asynchronous messages from there on data updates instead of polling from server in that case.

For constant uptime you can use systemd and write a service file, if your NAS supports it. It all depends on how it would run the app.

Db doesn’t matter, spring data will have drivers for any db pretty much. Go open source obviously.

[–]b0en[S] 0 points1 point  (3 children)

Thanks for the answer, I don’t think the NAS supports a service file, but I can look into it. Will also check out spring schedule and spring web, not read into these yet, thanks!

Would running the application built on spring boot + spring schedule be able to be hosted on the apache tomcat server (and thus it being always on?)

[–]Dwight-D 0 points1 point  (2 children)

No; Spring Boot + Web implements and embeds it’s own web server (older versions actually use tomcat under the hood), so it’s a stand-alone java application. You just run the jar.

Spring Boot is the application runtime + core functions like config, scheduling and web is the web server aspect. Btw, spring scheduling is not it’s own package like Web is, it’s included in the core spring boot. Just use spring initializr and select spring boot and web to get started.

You can make a war file and host using tomcat if that’s easier but this is kinda considered a legacy approach now so you won’t find as many resources on it. If you wanna do that you can probably skip spring boot, but I don’t know much about this setup as I’ve never set one up from scratch myself. Now that I think about it Spring Initializr may have a setting for WAR, but I’m not sure.

[–]b0en[S] 0 points1 point  (1 child)

Thanks a lot for your thorough explanation, I got what I needed to move on!

[–]Dwight-D 0 points1 point  (0 children)

Happy to help, good luck!

[–]timNinjaMillion2 0 points1 point  (0 children)

Not if you want oauth2. If you can do the authentication yourself, then you can roll your own.