What services are required for AppFabric to run properly and monitor WCF Services - wcf

I'm running AppFabric on IIS7 with Windows 7 for development.
AppFabric works fine for some period of time, but then it will stop updating.
I can send service requests through, and AppFabric doesn't show them in the dashboard when I refresh it.
I think a service is stopping, or there's a permission issue. Does anyone know what services are required to for AppFabric to run properly?

SQL Server and AppFabric Event Collection Service, off the top of my head (for event collection; there are other services, but since you say AppFabric itself runs requests, I presume they're OK). There's also Event Tracing for Windows, but it's not, strictly speaking, a service.
I presume you've also checked the tracking profile is set correctly and have looked in the Application event log?

Related

IIS Restart Web API in ordered

When IIS Server is the outage, the server is restarted and all applications and web APIs are restarted as well, the problem I'm facing that some Web API depends on BUS. Could we let site/app wait until BUS ready before starting from IIS without touching the application code? In Docker, we can use the WAIT command or other third parties to wait until service is available before starting a container.
The Web API we are built on .Net Core 3.1
Any help is appreciated.
During the startup could you use something like
https://github.com/App-vNext/Polly to enter a period of retry
(https://github.com/App-vNext/Polly#retry). This would allow you to
retry the call to the API until it's hopefully it's available.
Use a windows service to monitor heartbeats of the applications and trigger application pool restarts on applications not working correctly. This should help you get into a running state.
Ultimately I'd try and remove this dependency, if you could give a little more information around the webapi requirements I'd be happy to suggest more ideas.

Is WAS activation over MSMQ a legend or what?

I'm working on my fourth or fifth implementation of a WCF service over MSQM with IIS/WAS activation. And I was never able to make it work properly. It's always the same story: my services are activated only if the IIS web site was interacted some other way (like servicing the service metadata page at /somewhere/myService.svc). Suddenly, if the only thing happening is sending messages into the queue, my services stop to process messages, and restart as soon as I visit the .svc page...
It's a so common pattern for me, that I also came to a common solution: scheduling a job (every few minutes) that runs a powershell script that access that page. Quite simple, but not very elegant. And, further more, unnecessary in theory.
This happened over different IIS versions (7.0 and 7.5), over various Win 2008 service packs and releases and with server in AD domains or workgroups. I think I've read every bits on the web about this, especially MSDN and microsofties blog, so binding configuration, MSMQ permissions, and all the other small details you can discover here and there are set up.
So the question: does anybody was successful with WAS over MSMQ?

Auto-start appfabric seems to work sequentially

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.

Ensuring (restart of) MSMQ WCF service hosted on IIS7.5 WAS

We have been tumbling, for more than a month now, with an issue where a wcf msmq service hosted in IIS7.5 (WAS) will stop processing messages from the queue.
We have been unable to narrow it down more than "at some point" it will stop processing messages from the queue. Calling the svc through a http browser call will start the processing again.
After reading really many articles, blogs and forum posts about this issue we have ensured the following: Security settings, protocol bindings and msmq/service naming, but alas: the service will still stop processing messages (at some point).
Encouraged by this article http://www.daczkowski.net/2010/11/19/leveraging-msmq-in-asp-net-application-through-wcf-service/ we seem to have now finally (almost) eliminated the problem for windows server 2008 r2 sp1 64 bit, but it still seems to appear on Windows 7 32 bit.
Now to get to my question: Can anyone tell me if there actually exists a guarentee (documentation on this would be appreciated) that a msmq WAS hosted wcf service will actually restart (under all conditions) on a IIS7.5 NOT running the AppFabric extension?
I am aware that this question is very compounded, but I'm hard pressed for documentation on why we should extend our OTS package with AppFabric to resolve this restart problem.
Best regards,
Are you're net.msmq endpoints actually using addresses that IIS can bind to a queue name? It's possible to use non-IIS compatible names in the config and WAS won't really ever be able to wake your application up because WAS will only ever register to queues following a path name it can resolve. In that case you need something like AppFabric or a "startup" script to actually activate your services so that they will bind to the queues in their own.

WF4 delay/ resume in WorkflowServiceApplication on IIS5 and 6

I have my workflow hosted in a WorkflowServiceApplication running on IIS5 (production environment will be IIS6) with a persistence database. It's a request/approval service so there's a delay (a few days) whilst waiting for approval and if that delay passes with no approval the workflow sends an e-mail to the approver. I've noticed that the pending workflows only "wake up" and send their e-mails if I kick off a new request (i.e. new workflow instance). I assume that in starting a new flow something checks the instance store for instances that are due to resume and resumes them. I've only just noticed the problem because I was previously testing with delays that were just a few minutes rather than days. I haven't tried it on IIS6 yet but I expect it would be the same.
q1) do I need to write a console app or something to periodically check and resume the flows and if so can someone advise how to do it? Or have I just done something wrong?
q2) Assuming that the answer to Q1 is "yes, you need to write something" if I was to use IIS7 and AppFabric (which may be possible) would the sleep/resume just work without me having to write any code to check and resume the flows? i.e. just deploy the workflow service into AppFabric and it works?
Thanks in advance.
The answer to q1 is yes. After an IIS AppDomain recycles it is not restarted until there is an external request for it. As a result the WorkflowServiceHost is not active and expired Delay activities will not be resumed. With versions of IIS before 7 you need to create an external request to make sure the WorkflowServiceHost is available. The easiest way of doing so is just have a windows service periodically retrieve the WSDL page.
If your upgrade to IIS7 and AppFabric you can configure a service to automatically start as soon as IIS is running and that will take care of the same problem. I would prefer this option as AppFabric gives you a lot of extra benefits like tracking.
Yes Windows Server AppFabric's Workflow Management Service will wake up workflows with pending timers. You get this for free as well as other goodies.