How to implement WCF proxy pool?

What is the best practice for implementing WCF proxy pooling? What precautions should you take in design?

Any pointers in this direction would be greatly appreciated.

+2


source to share


2 answers


If you want to go this route, from Performance Enhancements to Building a WCF Proxy in .NET 3.5 and Best Practices :



  • You need to implement the right sync logic to control the proxy.

  • You need to make sure the proxies are used the same way. Sometimes, you may want to implement a circular proxy pattern.

  • You need to handle exceptions and retries for the pool.

  • The pool size should be limited and configurable.

  • You may need to create proxies even if there is no proxy available from the pool.

+4


source


Why do you want to merge proxies?

Pools usually only exist when a resource (such as a database connection) is scarce, expensive to build, and possibly expensive to maintain.

This shouldn't be the case with WCF proxies, really - you create them as needed and discard them when they are no longer needed.

I don't see any benefit or real use case when trying to pool WCF proxies - what problem or problem are you trying to solve?



OK, thanks for your answer - I understand what you are trying to accomplish, but I'm afraid you are pretty much alone as I don't think there are any pieces of .NET and / or WCF subsystem out there to help create proxy pools.

Mark

PS: as an article linked to the Tuzo show, maybe you can manage to just cache the channelFactory objects. These are really quite expensive to build, and if you can cache them for the life of the application, this might be enough for your needs. Check it!

+1


source







All Articles