I have a couple of wcf services which will call a registration service at startup (through a custom ServiceHostFactory). All these services (including the registration service) are running in the same app pool. I installed appfabric to auto-start all the services. I won't explain all the detailed settings (because I think it's not necessary yet), but in short, the services use net.tcp bindings and is running in IIS 7.5 on Windows 7.

The problem: When I set all services to auto-start it will begin with one (random) service, this service tries to connect to the registration service. But somehow this registration service won't start-up. It looks like it wants to start all services sequentially.

The (not wanted) solution 1: When I put the registration service in it's own app pool everything works fine and alle services come online in a matter of seconds and register themself.

The (not wanted) solution 2: When I disable the auto-start and try to access one of the services after a iisreset, it all works fine. The service will try to register itself and the registration service in his turn will start.

I'm new to appfabric, so it might be some simple configuration issue. The weird thing though is that it won't work whith auto-start, but seems to work fine with a manual start.

Any idea's?

有帮助吗?

解决方案

There is no priority in AppFabric Auto Start feature. You can't assume that one service will always be started before the others. Also, you can't assume they will start all at the same time.

For the specific scenario, it's recommanded to use WCF 4.0 Discovery and Announcement. Announcement feature enables service to announce their availability (by sending Hello and Bye announcements) whereas Discovery feature allow clients to discover service address at runtime.

All your services are on the same server ? could be pertinent to use a namedPipeBinding.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top