Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java web service architecture with REST

I am designing a Java web application that will be deployed to the Wildfly or Tomcat (not decided yet).

Basically it's about the offline java application that needs a REST interface for communication (to accept JSON data). The idea is that application runs all the time and processes the requests stored in redis cache (where the received JSON data is stored).

I used the Spring MVC framework for a web site in the past but I don't need the MVC pattern for the REST interface.

Is there a way you can point me to for using a Spring framework (or some other Java framework) to add the capability to recieve a POST requests to the existing offline application? Or it will be better to just write the REST service that will use the same cache as the existing application?

To illustrate my question I am attaching the simplified diagram of the architecture I am looking for:

Existing application and the extension

like image 570
CAPS LOCK Avatar asked Mar 17 '26 09:03

CAPS LOCK


2 Answers

As soon as you speak of receiving a POST request, you are automatically referring to a HTTP server.

The question is just whether that server is running as a service, or on-demand.

Is there a way you can point me to for using a Spring framework (or some other Java framework) to add the capability to recieve a POST requests to the existing offline application?

Not without introducing some sort of HTTP container, no.

Or it will be better to just write the REST service that will use the same cache as the existing application?

Yes, exactly. And as another mentioned, personally I'd stick with Spring MVC. But Jersey should also work very well for you for your usecase.

like image 197
kervin Avatar answered Mar 18 '26 23:03

kervin


I think you should use any light ESB, like Camel, Mule or Spring Integration. If you have already worked with Spring probably the latter will be the easiest for you.

The purpose of this kind of apps is to facilitate the task of communicating anything with anything (on this case, an HTTP endpoint with your offline app).

Take a look at this:

https://www.google.ie/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=spring%20integration%20http-inbound

like image 25
Andres Avatar answered Mar 18 '26 21:03

Andres



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!