aspose file tools*
The moose likes Spring and the fly likes Communication between two applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Communication between two applications" Watch "Communication between two applications" New topic
Author

Communication between two applications

vijay shanker
Ranch Hand

Joined: Oct 26, 2007
Posts: 88
Hi group ranchers,

I have two spring based applications; lets called App-A and App-B. App-A is primary application. App-B is serving as a client of App-A.

For communication between these two applications, i am using simple HTTP Request-Response cycle between these two applications.

Now i have a requirement two add another instance of App-B. when i deploy App-B; App-A will have two nodes to connect with services.

I am planning to use commons-pool for managing connection between these two nodes and App-A.

How should i proceed to design this integration
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

You're going to need to describe your application more...

When I hear "simple HTTP Request-Response" to communicate between client and server I assume it's something like REST. I'd assume that App-A is hosted on a server and just receives calls from the clients - why would you need your own pool to manage the clients? Are you not hosting your app in an app server - is it a standalone program that handles all the HTTP and ports by itself? Does anything need to be saved between calls on the server?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
vijay shanker
Ranch Hand

Joined: Oct 26, 2007
Posts: 88
Nathan Pruett wrote:You're going to need to describe your application more...


Description:--
App-A is main application which is responsible to serve all the incoming requests. there are multiple fronts from where the request may come to App-A.

there are multiple instances of App-B. This App-B is just forwarding its requests to App-A for the further processing as soon as it receive a request. App-b will send response back to user.
Hong Anderson
Ranch Hand

Joined: Jul 05, 2005
Posts: 1936
You can add Web Services in App A. You may be interested in JAX-RS.


SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCJP 5.0, SCEA 5, SCBCD 5; OCUP - Fundamental, Intermediate and Advanced; IBM Certified Solution Designer - OOAD, vUML 2; SpringSource Certified Spring Professional
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

vijay shanker wrote:
Nathan Pruett wrote:You're going to need to describe your application more...


Description:--
App-A is main application which is responsible to serve all the incoming requests. there are multiple fronts from where the request may come to App-A.

there are multiple instances of App-B. This App-B is just forwarding its requests to App-A for the further processing as soon as it receive a request. App-b will send response back to user.


I got that from your first post - I mean is App-A running in an application server, or standalone? Are you using anything specific to communicate between App-A and App-B(s) - you've said HTTP, but are you using REST or various Web Service protocols? Is there any state saved between calls?
vijay shanker
Ranch Hand

Joined: Oct 26, 2007
Posts: 88
My project to implement connection pooling between two server. and i am using connection pool as a mechanism to manage connections.

To communicate between these two servers i am using HttpClient library. Sending contents form A to B or C in the customized headers.

Now the problem part:
lets say i have two servers. main server is A. there are two other service providing services to this A. lets call then B and C.

My requirement:

I have 5 open connections from A to B. If all 5 connections are active and being used. then a should try to connect to server C. server C has also 5 open connection.

How should i design this connection manager.

My plan:
I should manage two different pools for both the servers. If server B got exhausted try to get a connection object from another pool.

Please let me know your expert opinions.
 
jQuery in Action, 2nd edition
 
subject: Communication between two applications