473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Using Multiple HttpWebRequests

Hello All,

I am implementing some functionality within my application where I
need to use the HttpWebRequest to call a 3rd party service
(messaging). The URLs that I use have the form of:

https://www.foo.com/Service?name=BOB&.....

Each URL will differ by the parameters - the above example has BOB as
the name. Now I would like to be able to send up to 1000 messages in
one block. Does this imply that I would need to create 1000 web
requests or is there a way of reusing a single connection? (The create
method takes a URL so I doubt it.) I am slightly concious of the
scalibility of creating all these requests and the impact it would
have on my application.

Any help would be appreciated.

Thanks,

Jose

Oct 27 '07 #1
4 1969

<jp***********@gmail.comwrote in message
news:11**********************@o80g2000hse.googlegr oups.com...
Hello All,

I am implementing some functionality within my application where I
need to use the HttpWebRequest to call a 3rd party service
(messaging). The URLs that I use have the form of:

https://www.foo.com/Service?name=BOB&.....

Each URL will differ by the parameters - the above example has BOB as
the name. Now I would like to be able to send up to 1000 messages in
one block. Does this imply that I would need to create 1000 web
requests or is there a way of reusing a single connection? (The create
method takes a URL so I doubt it.) I am slightly concious of the
scalibility of creating all these requests and the impact it would
have on my application.

Any help would be appreciated.
So, why can you not put the messages in one stream of messages and send them
all on one request?

Don't you have some requirements from the 3rd party vendor as to what you
can, cannot do, and how you can do it or made contact with the 3rd party
vendor about this?

If you have not done this, then that's where you need to start is with the
service vendor.

Oct 27 '07 #2
Each message would need to be sent on a separate request. The most efficient
way to do this is to use the ThreadPool (or a custom threadpool such as Ami
Bar's "Smartthreadpool" at codeproject.com).
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"jp***********@gmail.com" wrote:
Hello All,

I am implementing some functionality within my application where I
need to use the HttpWebRequest to call a 3rd party service
(messaging). The URLs that I use have the form of:

https://www.foo.com/Service?name=BOB&.....

Each URL will differ by the parameters - the above example has BOB as
the name. Now I would like to be able to send up to 1000 messages in
one block. Does this imply that I would need to create 1000 web
requests or is there a way of reusing a single connection? (The create
method takes a URL so I doubt it.) I am slightly concious of the
scalibility of creating all these requests and the impact it would
have on my application.

Any help would be appreciated.

Thanks,

Jose

Oct 27 '07 #3
jp***********@gmail.com wrote:
I am implementing some functionality within my application where I
need to use the HttpWebRequest to call a 3rd party service
(messaging). The URLs that I use have the form of:

https://www.foo.com/Service?name=BOB&.....

Each URL will differ by the parameters - the above example has BOB as
the name. Now I would like to be able to send up to 1000 messages in
one block. Does this imply that I would need to create 1000 web
requests or is there a way of reusing a single connection? (The create
method takes a URL so I doubt it.) I am slightly concious of the
scalibility of creating all these requests and the impact it would
have on my application.
One (Http)WebRequest per call.

It has a KeepAlive property that you can use to reuse the TCP/IP
connection.

Scalability is probably more a problem for the guy in the other
end.

You just need to decide on whether you want:
1 thread making 1000 requests
10 threads making 100 requests
100 thread making 10 requests
1000 thread making 1 request

I would go for a reasonable small number of threads, because
more threads will decrease not increase performance after a
certain number of threads is reached.

Arne
Oct 27 '07 #4
On 27 Oct, 20:38, Arne Vajhøj <a...@vajhoej.dkwrote:
jperezvazq...@gmail.com wrote:
I am implementing some functionality within my application where I
need to use the HttpWebRequest to call a 3rd party service
(messaging). The URLs that I use have the form of:
https://www.foo.com/Service?name=BOB&.....
Each URL will differ by the parameters - the above example has BOB as
the name. Now I would like to be able to send up to 1000 messages in
one block. Does this imply that I would need to create 1000 web
requests or is there a way of reusing a single connection? (The create
method takes a URL so I doubt it.) I am slightly concious of the
scalibility of creating all these requests and the impact it would
have on my application.

One (Http)WebRequest per call.

It has a KeepAlive property that you can use to reuse the TCP/IP
connection.

Scalability is probably more a problem for the guy in the other
end.

You just need to decide on whether you want:
1 thread making 1000 requests
10 threads making 100 requests
100 thread making 10 requests
1000 thread making 1 request

I would go for a reasonable small number of threads, because
more threads will decrease not increase performance after a
certain number of threads is reached.

Arne
Thanks for your help Arne and Peter. I will begin with the
Smartthreadpool.

Saludos,

Jose

Oct 28 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
4
by: Jeff | last post by:
We have multiple ASP.Net web apps in development. As a standard we are looking to go with SQL Server to hold state information. Can we have the multiple apps all point to a single State DB? Or...
5
by: | last post by:
Hi all, HttpWebRequest, and SoapHttpClientProtocol both expose a ClientCertificates property, which can hold multiple client certificates, but on the service side, it can only receive one client...
4
by: Gregory Gadow | last post by:
I've cobbled together a PrinterClass that takes a text file and dumps it to a printer. The app using is has multiple threads, all of which need access to a shared instance. Can someone point me to...
7
by: djc | last post by:
I see many ways to accomplish setting up proxy settings for a web request in the documentation but many of them are marked as obsolete. 1) What is the current and correct way to tell all my...
14
by: ml_sauls | last post by:
I've built a system to enter and manage purchase orders. This is in use by >10 clients. Some use it in Access 97, most are in A2k. About half use it through a Citrix implementation. It is...
35
by: keerthyragavendran | last post by:
hi i'm downloading a single file using multiple threads... how can i specify a particular range of bytes alone from a single large file... for example say if i need only bytes ranging from...
3
by: Tigera | last post by:
Greetings, I too have succumbed to the perhaps foolish urge to write a video game, and I have been struggling with the implementation of multiple dispatch. I read through "More Effective C++"...
0
by: David | last post by:
- Are there any peculiarities with using curs.executemany(...) vs. multiple How many times are you calling execute vs a single executemany? The python call overhead will add up for thousands of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.