Can't Get Router To Run

Mar 17, 2009 at 5:39 PM
So I am trying to get the Router to run.

The line in particular is Router.cs line 239

subscriptionQueueSize = new PerformanceCounter(categoryName, subscriptionQueueSizeName, string.Empty, false);

When I run it, it gives me the error that this performance counter can only be initialized in readonly mode.

So I change the source code to the following:

subscriptionQueueSize = new PerformanceCounter(categoryName, subscriptionQueueSizeName, string.Empty, true);

And then I get the error category does not exist.

Might anybody give a hand here?


Christian Gross

Mar 17, 2009 at 6:11 PM
During setup, the PerformanceCounterSetup.exe executes. It creates the perf counters. It sounds like this did not run successfully. You need to run it with Admin privileges to create perf counters. Try running it again as Admin and see if things then work. You will find it in the folder where you installed the Router.
Mar 17, 2009 at 7:04 PM

I am creating this application from source code.  That means no setup...

Do I have to run setup?
Mar 17, 2009 at 7:14 PM
That would explain things. The simplest way is to run the appropriate setup. The setup will create the perf counters, the windows service, and gac some of the dll's. Then if you wanted to modify the code you could do it with all those things already done. If you go the manual route, build and run the PerformanceCounterSetup application. If you want to have multiple servers talking to each other, you would need to manually modify the config files. The setup prompts for the info and does it for you. When we roll it out to servers, we provide an answer file and run the setup in silent mode.

If you go the manual route, feel free to ask questions as you go.

Mar 17, 2009 at 7:18 PM
Oh that explains everything...

BTW cool piece of software...  Exactly what I need...
Jul 3, 2014 at 2:33 PM
Hi Keith

I'm trying to get 3.0 version run on Windows 7 platform. I've receiving the same error christianhgross mentioned some time ago, but I'm suspecting he was using previous version of tis software.

By the way, I ensured to run installer using admin privileges, moreover I actually can see performance counter already created, but as soon as I create an instance of WspEventObservable I get an exception saying that performance counter can only be initialized in readonly mode because it isn't a custom performance coounter.

I'm planning to use this piece of software in a realtime middleware tier distributed application, to carry on events that makes distributed nodes to become updated and invalidate local instances based on state changes or user actions.

Please can you give me some hints on this problem.

Many thanks in advance.
Jul 3, 2014 at 5:33 PM
After you install Wsp with admin privileges, did you start the Wsp service and does it keep running? When it's running, you should also see it's perf counters.

If the Wsp service is running, I wouldn't expect a client app to have any issues creating an instance of WspEventObservable.
Jul 3, 2014 at 9:16 PM
Thanks Keith.

Sorry for this late response, I was trying to check everything before reply. To be sure, I restarted my PC also.

Wsp is running ok. If I try to subscribe with WspEventObservable, it throws an InvalidOperationException regarding counter not being a custom performance counter.

So, I decide to run sample EventPingPong with success. Just one thing about it is that it only works if I subscirbe in the first place, and then choose publish event option on the other instance. Other way dosn't work.

The counterpart is that if I run the same sample from source code I get the same exception about performance counter, but compiled solution bundled with installer works fine.

Please tell me if you need more details on this issue to help me.

Thanks again for you early response.
Jul 3, 2014 at 9:20 PM
Sorry, I forgot to mention that perfcounters are viewed when running EventPingPong, EventsProcessed and EventsProcessedBytes are showing data.

Aditional info: WspEventListenTest and WspEventServiceTest works fine and also related perf counters shows up on this running.
Jul 3, 2014 at 9:50 PM
When you run your code, try running it from the same console as you run EventPingPong and WspEventListenTest from to make sure you're using the same privileges. If it still doesn't work then send me the code.