Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communication between two applications

 
vijay shanker
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
vijay shanker
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add Web Services in App A. You may be interested in JAX-RS.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic