• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

posting parallely on multiple servers

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to General Java.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
aneesh, please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/advanced-java/63150-parallel-processing-java.html
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic