Help Deploying please

Oct 8, 2012 at 2:12 PM

Hi there,

My Project Overview
My project manages emergency telephones on Highways. People can use these telephones to ask for assistence. My application is a WCF service that comunicates with these emergengy telephones and publishes what comes from them to User Interfaces (UI).  These UI's can then themselves publish to the other UI's (for example, when a call comes in it rings on all UI's. When one of them picks up the call, it published to the others that the call is already answered).

Just as a side note, some UI's are implemented in Silverlight, while others are WPF applications.

What i need is something that can publish independent if it's through IIS or just a WPF windows application.

How to Deploy this?
From what i understand, i need to have a WPSEventRouter Origin and a WPSEventRouter Primary. What i dont understands is, is this suppoded to be 2 diferent machines with the WPSEventRouter service running on them, where on would be the origin the other the primary?

What I've already done
I installed the WspEventRouterSetupx64Release and the service appears in windows service list. After meddling around with the config i was able to run the service but only if I put it as primary. If i put it as origin I always get an error.

Generates Error
<configInfo role="origin" autoConfig="true" bootstrapUrl="http://WspOrigin/GetConfig" mgmtGroup="9929A145-BF9A-4141-8FE7-5C0420467BB1“ cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321" />

Error: The Error is An unhandled exception ('System.Net.HttpListenerException') occurred in WspEventRounter.exe [4924]

Service Runs
<configInfo role="primary" autoConfig="true" bootstrapUrl="http://WspOrigin/GetConfig" mgmtGroup="9929A145-BF9A-4141-8FE7-5C0420467BB1“ cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321" />

 Thank you for any help.

My best regard.

Coordinator
Oct 8, 2012 at 5:22 PM

When a server is running as Origin, it needs to open port 80. This means you need to go to Server Manager and add the Web Server role. This is if you want to use the bootstrapurl. You would have the bootstrapurl point to the Origin server. This makes it easy to deploy your clients since you give the clients the bootstrapurl and they get their config file from the Origin when they initially start.

You don't need an Origin and a Primary. I plan for no more than 400 clients per parent. If you have less than 400 clients, you could have all the clients use the Origin as their parent. It will also depend upon how many events per second you would be publishing. One more factor is if you have multiple data centers. I have a primary for each data center which improves efficiency across the WANs.

If you answer some of these questions and need help, I can help you with your config file.

Oct 8, 2012 at 6:45 PM
Edited Oct 8, 2012 at 6:48 PM

Hey Keithh,

Thank you for the quick response :)

keithh wrote:

When a server is running as Origin, it needs to open port 80. This means you need to go to Server Manager and add the Web Server role. This is if you want to use the bootstrapurl. You would have the bootstrapurl point to the Origin server. This makes it easy to deploy your clients since you give the clients the bootstrapurl and they get their config file from the Origin when they initially start.

You don't need an Origin and a Primary. I plan for no more than 400 clients per parent. If you have less than 400 clients, you could have all the clients use the Origin as their parent. It will also depend upon how many events per second you would be publishing. One more factor is if you have multiple data centers. I have a primary for each data center which improves efficiency across the WANs.

If you answer some of these questions and need help, I can help you with your config file.

 So this mean i always have to have an Origin but dont need a Primary right? Also on windows 7, there isnt a Server Manager. How do i procede with this?

 

I'm currently testing this with 2 machines. These are  the config files for the 2 machines

Machine defined as primary config file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="eventRouterSettings" type="RouterSettings"/>
    <section name="eventPersistSettings" type="PersistSettings"/>
  </configSections>

  <eventRouterSettings>
    <configInfo role="primary" autoConfig="true" bootstrapUrl="http://192.168.10.30/GetConfig" mgmtGroup="D979AEB4-C501-4027-BBCA-C38F7B56FD00" cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321"/>


    <originRoleInfo>
      <subscriptionManagement refreshIncrement="3"  expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
    </originRoleInfo>

    <primaryRoleInfo>
      <subscriptionManagement refreshIncrement="3"  expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
      <parentRouter name="192.168.10.30" numConnections="10" port="1300" bufferSize="1024000" timeout="30000" />
    </primaryRoleInfo>

    <clientRoleInfo>
      <subscriptionManagement refreshIncrement="3"  expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="102400000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="0" bufferSize="1024000" timeout="30000" />
      <parentRouter name="192.168.10.32" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" />
    </clientRoleInfo>

  </eventRouterSettings>
  <eventPersistSettings>
  </eventPersistSettings>
</configuration>
 
Machine defined as client config file: 
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="eventRouterSettings" type="RouterSettings"/>
    <section name="eventPersistSettings" type="PersistSettings"/>
  </configSections>

  <eventRouterSettings>
    <configInfo role="client" autoConfig="true" bootstrapUrl="http://192.168.10.30/GetConfig" mgmtGroup="D979AEB4-C501-4027-BBCA-C38F7B56FD00" cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321"/>


    <originRoleInfo>
      <subscriptionManagement refreshIncrement="3"  expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
      <!-- <parentRouter name="" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" /> -->
    </originRoleInfo>

    <primaryRoleInfo>
      <subscriptionManagement refreshIncrement="3"  expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
      <parentRouter name="192.168.10.30" numConnections="10" port="1300" bufferSize="1024000" timeout="30000" />
    </primaryRoleInfo>

    <clientRoleInfo>
      <subscriptionManagement refreshIncrement="3"  expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="102400000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="0" bufferSize="1024000" timeout="30000" />
      <parentRouter name="192.168.10.30" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" />
    </clientRoleInfo>

  </eventRouterSettings>
  <eventPersistSettings>

  </eventPersistSettings>
</configuration>

Executing netstat -an | findstr 1300 on the primary and client machines i get the following:

Primary:
  TCP    0.0.0.0:1300           0.0.0.0:0              LISTENING
  TCP    192.168.10.30:1300     192.168.10.30:21280    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21281    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21282    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21283    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21284    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21285    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21286    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.30:21287    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.32:55806    ESTABLISHED
  TCP    192.168.10.30:1300     192.168.10.32:55814    ESTABLISHED
  TCP    192.168.10.30:21280    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21281    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21282    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21283    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21284    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21285    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21286    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.30:21287    192.168.10.30:1300     ESTABLISHED

Client:
  TCP    192.168.10.32:54542    192.168.10.30:1300     ESTABLISHED
  TCP    192.168.10.32:54550    192.168.10.30:1300     ESTABLISHED

Executing the project EventPingPong on both machines with one as subscriber and the other as publisher, it seems to be working. But when trying the WspEventListenTest + WspEventServiceTest it only works locally (I changed the code of the WspEventListenTest so the LocalOnly was set to false).

Also tried making a custom event and again only seems to be working when both publisher and subscriber are on the same machine. I'm a little lost and any help would be very appreciated.

One other question is about silverlight. Since silverlight uses its own DLL's in the framework, and the DLL's to be included in a silverlight project need to be compliled as silverlight DLLs, how can i get around this since i would need to include MyEvends ddl ?

Again thank you for you time.

My best regards

Coordinator
Oct 8, 2012 at 10:29 PM

You don't want to have a parent defined for the Primary, so your config file should be this below for both machines but with the role being the only difference. So the role for the 192.168.10.30 server is "primary" and the role for the other is "client".

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="eventRouterSettings" type="RouterSettings"/>
<section name="eventPersistSettings" type="PersistSettings"/>
</configSections>

<eventRouterSettings>
<configInfo role="client" autoConfig="true" bootstrapUrl="http://192.168.10.30/GetConfig" mgmtGroup="D979AEB4-C501-4027-BBCA-C38F7B56FD00" cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321"/>


<originRoleInfo>
<subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
<localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
<outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
<thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
<!-- <parentRouter name="" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" /> -->
</originRoleInfo>

<primaryRoleInfo>
<subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
<localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
<outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
<thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
</primaryRoleInfo>

<clientRoleInfo>
<subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
<localPublish eventQueueName="WspEventQueue" eventQueueSize="102400000" averageEventSize="10240"/>
<outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
<thisRouter nic="" port="0" bufferSize="1024000" timeout="30000" />
<parentRouter name="192.168.10.30" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" />
</clientRoleInfo>

</eventRouterSettings>
<eventPersistSettings>

</eventPersistSettings>
</configuration>

 

I'm not really sure where to install IIS on a Win7 machine. It might be at Control Panel -> Programs & Features -> Windows Features. If you do get it installed then you can change the server role from "primary" to "origin" and the bootstrapurl will work and the auto config update will work.

After you change to this config file, you should no longer see from/to ports with the same IP address. Then retry the samples from the modified code with LocalOnly = false.

For SilverLight, you will need to break it into a server and UI. The service portion would do the publish/subscribe and it could expose a restful interface for the UI to interact with.

Oct 9, 2012 at 9:53 AM
Edited Oct 9, 2012 at 10:36 AM

Hey Keithh,

Once again your help is invaluable. Thank you for spending your time helping me out :)

I didnt mention of my previous post but IIS was already installed, but it seemed IIS was having problems because of internal network policies. So i did a reinstalation of IIS and everything started working :D :D :D

This is really a great breakthrough and i hope it will solve some problems we are having with our publish-subscriber service.

I'm going to try and get this to work with silverlight too. If i can get it to work and if you want i can post here the solution i used.

You are a life saver

Best regards

Coordinator
Oct 9, 2012 at 1:27 PM

If IIS is already on the parent server then you should be able to change its role to "origin". It should not give you the Http listener exception. Make sure the firewall is open for WspEventRouter. Only the origin role needs IIS installed. So if you only have the origin and client roles, your config would be:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="eventRouterSettings" type="RouterSettings"/>
<section name="eventPersistSettings" type="PersistSettings"/>
</configSections>

<eventRouterSettings>
<configInfo role="client" autoConfig="true" bootstrapUrl="http://192.168.10.30/GetConfig" mgmtGroup="D979AEB4-C501-4027-BBCA-C38F7B56FD00" cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321"/>


<originRoleInfo>
<subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
<localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
<outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
<thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
<!-- <parentRouter name="" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" /> -->
</originRoleInfo>

<clientRoleInfo>
<subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
<localPublish eventQueueName="WspEventQueue" eventQueueSize="102400000" averageEventSize="10240"/>
<outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
<thisRouter nic="" port="0" bufferSize="1024000" timeout="30000" />
<parentRouter name="192.168.10.30" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" />
</clientRoleInfo>

</eventRouterSettings>
<eventPersistSettings>

</eventPersistSettings>
</configuration>

Oct 9, 2012 at 2:43 PM

Everything is working and I was able to put diferent machines publishing and subscribing.

Silverlight is going to be more dificult that expected. It uses a completly diferent set of DLL's inside the framework. Trying out the Portable Class Library that allow to complile for .Net 4.0 and Silverlight but once again there is a great limitation on the namespaces available (For example there is no System.Net.Sockets.Dns available).

Do you think there is any way we could put some kind of middleware between your solution and Silverlight UI?


Coordinator
Oct 10, 2012 at 6:40 AM

I think you need to have a web service with a restful interface that your UI interacts with. The web service would do the publish/subscribe. This shouldn't be too hard.

Oct 12, 2012 at 3:05 PM

So we have the publish / subscriber working with our WCF service and it does wonders. We are very happy with this and want to thank you for sharing this with us.

Since testing was doing fine, we decided to do a production test and see if we could get this working in the real environment.  So we installed a Web server role (the OS is Windows 2008 server) and tested the http://localhost and everything seems ok.

So next we proceeded to install the WspEventRouter using the installers you have here for download (the x64 version since all machines are x64). We changed to configuration files to match the ones on the post above, only changing the IP's to match the origin machine. We installed it also on all cliente machines.

We are having a problem starting the WspEventRouter service on both origin and clients. We are getting the following error:

The WspEventRouter service terminated unexpectedly.  It has done this 3 time(s).

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
  <Provider Name="Service Control Manager" Guid="{555908d1-a6d7-4695-8e1e-26931d2012f4}" EventSourceName="Service Control Manager" /> 
  <EventID Qualifiers="49152">7034</EventID> 
  <Version>0</Version> 
  <Level>2</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x8080000000000000</Keywords> 
  <TimeCreated SystemTime="2012-10-12T13:28:16.230583400Z" /> 
  <EventRecordID>13380</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="524" ThreadID="1320" /> 
  <Channel>System</Channel> 
  <Computer>CALLBOX-APL</Computer> 
  <Security /> 
  </System>
 <EventData>
  <Data Name="param1">WspEventRouter</Data> 
  <Data Name="param2">3</Data> 
  </EventData>
  </Event>

We also disabled all firewalls. netstat obviously didnt return anything.

Do have any ideia of what the problem can be?

Coordinator
Oct 12, 2012 at 3:33 PM

It sounds like you didn't install the Microsoft Visual C++ 2010 Redistributable Package.

 

Coordinator
Oct 12, 2012 at 3:34 PM

BTW, be sure to install both the x86 and x64 redists on a x64 server.

Nov 19, 2012 at 3:05 PM

Hey Keith,

Just wanted to tell you that everything is in production and working perfectly. Your publish subscriber is just what we need to finally stabilize our service.

So, thank you for releasing this!! it was really life saving :)

Dec 17, 2012 at 5:26 PM

Hello Keith,

A problem arised with WspEventRouter on a client. The only diference between this client and the rest is that it's on a diferent network. Client is on ip, for example 172.10.33.156 and origin is on ip 10.50.206.1. When trying to run the client's WspEventRouter service, this error appear on the event viewer:

System.Net.Sockets.SocketException: This Host is not known
   in System.Net.Dns.GetAddrInfo(String name)
   in System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6, Boolean throwOnFailure)
   in System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   in Microsoft.WebSolutionsPlatform.Event.Router.Communicator.ConnectSocket(String server, Int32 port) on C:\Builds\387\MSN Core Platform\WspEventSystem Build\Sources\Router\Communicator.cs:line 425
   in Microsoft.WebSolutionsPlatform.Event.Router.Communicator.OpenParentSocket() on C:\Builds\387\MSN Core Platform\WspEventSystem Build\Sources\Router\Communicator.cs:line 359

Is there any configuration we need to do for it to work with diferent network?

P.S - The Client machine can ping the origin machine.

 

Coordinator
Dec 17, 2012 at 5:37 PM

From: Wheels

Hello Keith,

A problem arised with WspEventRouter on a client. The only diference between this client and the rest is that it's on a diferent network. Client is on ip, for example 172.10.33.156 and origin is on ip 10.50.206.1. When trying to run the client's WspEventRouter service, this error appear on the event viewer:

System.Net.Sockets.SocketException: This Host is not known
   in System.Net.Dns.GetAddrInfo(String name)
   in System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6, Boolean throwOnFailure)
   in System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   in Microsoft.WebSolutionsPlatform.Event.Router.Communicator.ConnectSocket(String server, Int32 port) on C:\Builds\387\MSN Core Platform\WspEventSystem Build\Sources\Router\Communicator.cs:line 425
   in Microsoft.WebSolutionsPlatform.Event.Router.Communicator.OpenParentSocket() on C:\Builds\387\MSN Core Platform\WspEventSystem Build\Sources\Router\Communicator.cs:line 359

Is there any configuration we need to do for it to work with diferent network?

P.S - The Client machine can ping the origin machine.

Dec 17, 2012 at 5:49 PM

Hey Keith,

For some reason all I can see from your reply is my quote. If you added anything else, I cant seem to read it.

Coordinator
Dec 18, 2012 at 5:50 AM

I wasn't at my computer all day and tried to reply from my cell phone but the text didn't go through.

The GetHostEntry tries to resolve the IP address via the DNS and it is failing. I'm not sure how the IP address gets into the DNS. You could switch to a hostname instead of an IP address and put the hostname in the DNS or a hosts file on the client. The other alternative would be to change the code to use GetHostAddresses instead of GetHostEntry. Here is a link to this issue: http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/2a8ca3c8-e1ec-490a-a7e5-5ec533080f00/.

 

Dec 18, 2012 at 10:46 AM

hey keith,

thank you for the reply.

I would like to ask you about another problem we are having. As i said some posts above, we converted the WPF application into a Web application. In our case, we used XBAP, so basically it's WPF application running on the browser.

XBAP works fine and we have it fully funcional with WspEventRouter. The problem arises when a random user tries to use the application, and by random i mean no Microsoft Visual C++ 2010 Redistributable Package and no WspEventRouter service installed. We have coded on our XBAP application to check and see if these are installed and if not, do a silent instalation.

Preliminary tests were successfull and tried on a bunch of diferent computers. Users would go to the browser, put the URL, it would start the XBAP download and it would installed everything, start WspEventRouter service and voilá :) seemed to be working fine.

We then started doing some tests with the client and thats when problems started. Doing the silent instalation of the Microsoft Visual C++ 2010 Redistributable Package almost always gave us some problems. Until now the main problems are (there may be more):

  • Reading the registry to check if Microsoft Visual C++ 2010 Redistributable Package is installed - This can lead to some problems since we are dealing with 3 diferent languages: Portuguese, English and Brazilian - So the registry is a little diferent for the languages (in the future there can be more). Another problem is if the user doesnt have privileges to read the registry.
  • No admin rights - The user may not have privileges to install software. Since it has to be a Web application, the client just want to go to the browser and use the application.

My biggest questions is: It it really needed for all clients to have WspEventRouter installed? is there any way to workaround it? If not do you think there is any solution for this?

If no solution can be arranjed I'm afraid we will have to abandon this solution because the client demands this to be a Web application (despite making no sense). I was really happy with this solution since it provided a very reliable publish / subcriber. This is already working flawlessly on another client with the WPF application

 

Coordinator
Dec 18, 2012 at 12:56 PM

I guess you have a couple of alternatives. If you don't want any of the Wsp bits on the client, you would need to write a server-side proxy which the client interacts with. This would all be your code.

You could modify Wsp so you can do an xcopy deploy. You'd need to disable the code which relates to perf counters. To deploy, you would xcopy the few DLL's, config file, and EXE for Wsp and the DLL which is used from the C redist to a folder on the client. You'd then start the WspEventRouter.exe in a background process and give it any parameter, e.g. "wspeventrouter.exe run". Wsp will run until you kill the process. Since you wouldn't be running an install, it should solve the issue of the user not having admin rights.

Dec 18, 2012 at 6:33 PM
Edited Dec 18, 2012 at 6:33 PM

I like the second ideia, allowing me to just copy the files needed. I think this could be a solution to my problem.

I found references to PerformanceCounter in:

  • CommandProcessor;
  • Communicator;
  • Router;
  • SynchronizationQueue;
  • ProjectInstaller;

 So I should just comment all code that refers to System.Diagnostic.PerformanceCounter? or is there anything else i need to do?


Coordinator
Dec 18, 2012 at 7:04 PM

Right, you should just have to comment out the code which references the perf counters, rebuild, and you should be good.

Dec 20, 2012 at 3:25 PM
Edited Dec 20, 2012 at 3:29 PM

Hey Keihh,

So I started taking all code relating to per counters, copied all files needed to run wspEventRouter and started it. On my laptop everything is working fine. I then started doing tests on other computers and everything seemd to be working until an error started occuring.  Not all computers have this problem since i have a x86 machine running it fine.

It's the same on all machines that have this problem. The error seems to occur at random times and only when starting WspEventRounter. Once the error happens, the only way that seems to make it work again is restarting the machine.

Unhandled Exception: Microsoft.WebSolutionsPlatform.Common.SharedQueueInitializa
tionException: (HRESULT:InsufficientSpace) SharedQueue failed to initialize
   at Microsoft.WebSolutionsPlatform.Common.SharedQueue..ctor(String name, UInt3
2 size, UInt32 averageItemSize)
   at Microsoft.WebSolutionsPlatform.Event.Router.Listener.Start() in D:\Develop
ment\SW SOS Brasil\Web Based Publisher Subscriber\Project\v2.2\Router\Listener.c
s:line 29
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
ontextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

The error happends on this line on the Listener.cs file.

eventQueue = new SharedQueue(eventQueueName, eventQueueSize, (uint)averageEventSize);

and is related to this line on the ShareQueue.cs file

ReturnCode rc = NativeMethods.InitMemoryMgr(name, size, ref commBuffer);

On a side note, if the computer has the installed WspEventRounter and starts it, running the version without instalations seems to work without problems. Stopping the installed version and running again the other version the error appears once again Do you have any ideia what may be the problem?

Coordinator
Dec 20, 2012 at 3:35 PM

Check the shared memory queue size in the config file. It might need to decrease in size for computers with smaller amounts of memory.

Dec 20, 2012 at 3:59 PM
Edited Dec 20, 2012 at 3:59 PM

Just to simply lets call Installed Version the one that is insllated as a service and File Version the one that is run from files.

I thought about that, but on the same machine, the installed version never gives this error and the file version does (with the same config file). And even more strange is that if I start the Installed version the File Version also runs fine

So I have these behaviours:

  • Installed version stopped and File version works fine;
  • File version stops working after restarting (seems to happen after starting the process from the XBAP web application);
  • Start Installed version and run File version and everything works;
  • Stop Installed version and File Version stops working.
Coordinator
Dec 20, 2012 at 4:10 PM

Only have the file version on the computer and send me the config file you are using for it. Start the computer cleanly with only the file version. How are you starting the file version?

Dec 20, 2012 at 4:19 PM

This is the config file we're using

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="eventRouterSettings" type="RouterSettings"/>
    <section name="eventPersistSettings" type="PersistSettings"/>
  </configSections>

  <eventRouterSettings>
    <configInfo role="origin" autoConfig="true" bootstrapUrl="http://172.16.20.32/GetConfig" mgmtGroup="D979AEB4-C501-4027-BBCA-C38F7B56FD00" cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321"/>
    <originRoleInfo>
      <subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
      <!-- <parentRouter name="" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" /> -->
    </originRoleInfo>

    <primaryRoleInfo>
      <subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
    </primaryRoleInfo>

    <clientRoleInfo>
      <subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="102400000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="20000000" maxTimeout="600"/>
      <thisRouter nic="" port="0" bufferSize="1024000" timeout="30000" />
      <parentRouter name="172.16.20.32" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" />
    </clientRoleInfo>

  </eventRouterSettings>
  <eventPersistSettings>

  </eventPersistSettings>
</configuration>
To start the File Version we just execute something like
WspEventRouter.exe run
Coordinator
Dec 20, 2012 at 5:03 PM

Try this config file:

 

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="eventRouterSettings" type="RouterSettings"/>
    <section name="eventPersistSettings" type="PersistSettings"/>
  </configSections>

  <eventRouterSettings>
    <configInfo role="origin" autoConfig="true" bootstrapUrl="http://172.16.20.32/GetConfig" mgmtGroup="D979AEB4-C501-4027-BBCA-C38F7B56FD00" cmdGroup="C8EDEB22-7E4A-4441-B7B4-419DDB856321"/>
    <originRoleInfo>
      <subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="5000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
      <!-- <parentRouter name="" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" /> -->
    </originRoleInfo>

    <primaryRoleInfo>
      <subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="5000000" maxTimeout="600"/>
      <thisRouter nic="" port="1300" bufferSize="1024000" timeout="30000" />
    </primaryRoleInfo>

    <clientRoleInfo>
      <subscriptionManagement refreshIncrement="3" expirationIncrement="10"/>
      <localPublish eventQueueName="WspEventQueue" eventQueueSize="10240000" averageEventSize="10240"/>
      <outputCommunicationQueues maxQueueSize="5000000" maxTimeout="600"/>
      <thisRouter nic="" port="0" bufferSize="1024000" timeout="30000" />
      <parentRouter name="172.16.20.32" numConnections="2" port="1300" bufferSize="1024000" timeout="30000" />
    </clientRoleInfo>

  </eventRouterSettings>
  <eventPersistSettings>

  </eventPersistSettings>
</configuration>

 

BTW, if you want to reach me today, use my email at keithh@microsoft.com