File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes posting parallely on multiple servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "posting parallely on multiple servers" Watch "posting parallely on multiple servers" New topic
Author

posting parallely on multiple servers

aneesh veetile
Greenhorn

Joined: Feb 15, 2012
Posts: 9
Hello,

I have a requirement. i have to post a request parallely on two servers. The first thing that came to my mind was multithreading. since it is a clustered environment, they say multithreading would create problems. I am not sure what exactly the problem. Is there any way that we can implement parallel processing with out using multithreading. Also not using any queues. if it is possible kindly share the same, if possible with some samples. I am using webspere 7. Thanks in advance.

Regards,
Aneesh
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

This isn't really a servlet question, since the "posting" part is on the client. There's no special code required for servlets to handle multiple concurrent requests because it's build into the architecture.

So it would have been better to ask in one of the more advanced General Java forums.

Off the top of my head, posting parallel is not a problem, but I'd have to RTFM to see how to keep from hanging once you were ready to receive the responses. In the normal course of events, responses would all come back to a single port and you could just listen for incoming response traffic on it, but HTTP assigns a different, randomly-selected reply port to each outgoing request.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Moved to General Java.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
I have a requirement. i have to post a request parallely on two servers. The first thing that came to my mind was multithreading. since it is a clustered environment, they say multithreading would create problems.


What exactly is the client here? Unless the client is on one of the servers, I don't see how the server side environment makes any difference.

A separate Thread for each request is certainly the approach I would take.

Bill
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

William Brogden wrote:
I have a requirement. i have to post a request parallely on two servers. The first thing that came to my mind was multithreading. since it is a clustered environment, they say multithreading would create problems.


What exactly is the client here? Unless the client is on one of the servers, I don't see how the server side environment makes any difference.


Even then the only real difference it makes is that any threading would have to be done outside of a servlet/jsp process.


A separate Thread for each request is certainly the approach I would take.

Bill


Me too, if it's just 2 servers being posted. If it's 200, I'd go for something non-threaded.
aneesh veetile
Greenhorn

Joined: Feb 15, 2012
Posts: 9
Hi all, I apologize for the delayed response. i was away and were not able to access net.

Thanks for all your responses.

The scenaria is as follows.

From the application i have to post request (in xml format) parallely to two different servers. Since we are going to implement this in a clustered environment, they were saying that multithreading would create some issue.(not sure exactly what the issue is). If that is the case how do we post the requests parallely to two different servers.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4640
    
    5

aneesh, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/advanced-java/63150-parallel-processing-java.html


luck, db
There are no new questions, but there may be new answers.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

aneesh veetile wrote:Hi all, I apologize for the delayed response. i was away and were not able to access net.

Thanks for all your responses.

The scenaria is as follows.

From the application i have to post request (in xml format) parallely to two different servers. Since we are going to implement this in a clustered environment, they were saying that multithreading would create some issue.(not sure exactly what the issue is). If that is the case how do we post the requests parallely to two different servers.


Unfortunately, without knowing what this "multithreading issue" is, it's hard to make suggestions.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: posting parallely on multiple servers