Overview

The RI Router Service is a Windows Service that receives log message from remote ReflectInsight client applications anywhere on your network. Once log messages have been received, the RI Router Service will delegate them to destinations that have been configured where the service was installed.

The available communication protocols supported by RI Router Services are: TCP/IP, MSMQ and RMQ.

Note: developers are free to create their own communication protocol if required. They can simply implementing their own Message Read/Writer, in addition to configuring ReflectInsight clients and the RI Router Service that will receive log messages.

A few notes before we start

1. For simplicity, this guide will only focus on configuring the TCP/IP protocol. It is important to note, that the RI Router Service was designed to work with more than one protocol at any given time, given that ports are uniquely available during binding. For example, a single instance of the RI router Service can host two or more TCP/IP protocols, in addition to hosting the RMQ protocol, as long as they can bind to ports that are freely available.

2. The service can only be installed on machines where .NET 4.0 has been previously installed. ReflectInsight client applications can run on the .NET platform versions they have been developed for.

3. If you haven’t done so, please install the latest version of ReflectInsight. You can download it from here: ReflectInsight Viewer. Please make sure you install the correct OS version for your machine type (i.e. x86 or x64)

4. Make sure port(s) used by the RI Router Service are equally matched by the ReflectInsight client applications, are available and are not blocked by any firewall between them. In our example, we use port 8081 for the TCP/IP protocol. However, you can change the port value as necessary as long as they are matching between the ReflectInsight clients and RI Router Service.

RI Router Service: Step-by-Step

1. Navigate to where you installed ReflectInsight and copy the following folder:

ReflectInsightInstallLocation.png

2. Copy the RouterService directory.

3. Paste the folder to a desired root directory. In our example we chose C:\

4. Although not necessary, you can rename this folder. In our example we renamed it to C:\RI.RouterService

5. Navigate to C:\RI.RouterService and run the install.bat file. This will install the RI Router Service but set Startup in "Manual" mode (Note: you must run as an Administrator to install Windows services. Running in UAC as an Administrator may fail to install).

6. There are two configuration files that are shipped with the RI Router Service. Please note the differences between the two:
  • Router.Service.exe.config: Used by the Router Service. As default, this service has been configured to only run using the TCP/IP protocol. All other protocols have been disabled. If you want to change the default TCP/IP port value which is currently set to 8081, please do so here (Note: if you change the TCP/IP port on the service then ReflectInsight client application configuration files will need to match this port value as well. More on this topic in a proceeding section).
  • ReflectInsight.config: Used by the ReflectInsight logging framework. From the RI Router Service perspective, this is where the service will route remotely received log messages and send them to the configured destinations. The default configuration is set to route messages only to the Live Viewer destination. However, if you wish to send log messages to other destinations (i.e. BinaryFile, TextFile, etc.), you can do so by adding additional destinations (Note: if you plan to write to a destination bound to a physical file (i.e. BinaryFile, TextFile, etc.), you must allow the RI Router Service’s user account (currently set as Local System), to have read/write access to the directories where destination files are being logged and written).

7. Once, you have configured the RI Router Service, you can start the service manual. See image below:

ReflectInsight_SemanticLoggingService.png

8. Troubleshooting: The RI Router Service was design to provide diagnostic reporting to help insure that the service is running and configured properly. If you have any issues, you can either use the Event Viewer or the RI.Router.Services.txt located in a folder called Logs where the Router Service has been installed.

9. If the Router Service does not have access to the Event Viewer Log Repository you can easily turn this feature off. At minimum, you should at least have the Text File version enabled at all times. To turn "on" or "off" Event Viewer diagnostic reporting, please go to both configuration files (Router.Service.exe.config and ReflectInsight.config), navigate to the section shown below, and set the mode property value to “off”. Please insure that the RI Router Service’s user account has read/write access to the Logs directory. Although not necessary, you can restart the Router Service.

<exceptionManagement mode="on">
   <publisher mode="off"
                    name="EventPublisher" 
                    type="RI.Utils.ExceptionManagement.ExceptionEventPublisher, ReflectSoftware.Insight" 
                    applicationName="ReflectInsight" />

   <publisher mode="on" 
                    name="LogTextEventPublisher"
                    type="RI.Utils.ExceptionManagement.ExceptionLogTextFilePublisher,ReflectSoftware.Insight"
                    filePath="$(workingdir)\Logs\RI.Router.Services.txt" 
                    recycle="7" />
</exceptionManagement>

ReflectInsight Client Applications: Step-by-Step

These steps assume you are using the ReflectInsight.config as and external source rather than the app/web.config file housing ReflectInsight settings directly.

1. In the app/web.config file, please confirm the following sections are configured as shown below:

  <configuration>
    <configSections>
      <section name="insightSettings"          
               type="ReflectSoftware.Insight.ConfigurationHandler,ReflectSoftware.Insight" />
    </configSections>

    <insightSettings externalConfigSource="ReflectInsight.config" />
  </configuration>

2. If you haven’t already created a ReflectInsight.config file for your application, please do so and confirm that it is marked as “Copy if newer” in your project. This is important as the configuration must reside in the same directory as the running application. For web applications, "Copy if newer" should be set to "false".

3. In the ReflectInsight.config file, please confirm that the following sections have been configured:

<?xml version="1.0"?>
<configuration>
   <insightSettings>
      <baseSettings>
	     <propagateException enabled="false" />
         <global category="ReflectInsight" />
         <exceptionEventTracker time="20" />
         <requestObject requestLifeSpan="10" />
         <debugMessageProcess enabled="true" />
      </baseSettings>

	  <routers>
		  <router name="routerTCP"		   
				  type="RI.Messaging.ReadWriter.Implementation.TCP.TCPWriter,ReflectSoftware.Insight"
				  hostname="localhost"
				  port="8081"
				  connectionTimeout="3000"/>
	  </routers>

	  <listenerGroups active="MyGroup">
		  <group name="MyGroup" enabled="true" maskIdentities="false">
			 <destinations>
				<destination name="RouterTCP" enabled="true" filter=""
							 details="Router[name=routerTCP]" />
			 </destinations>
		  </group>
	  </listenerGroups>

      <exceptionManagement mode="on">
         <publisher mode="off"
                    name="LogTextEventPublisher"
                    type="RI.Utils.ExceptionManagement.ExceptionLogTextFilePublisher,ReflectSoftware.Insight"
		            filePath="$(workingdir)\Logs\ri_exceptions.txt"
		            recycle="7" />

         <publisher mode="on"
                	name="EventPublisher"
                    type="RI.Utils.ExceptionManagement.ExceptionEventPublisher,ReflectSoftware.Insight"
			        applicationName="ReflectInsight" />
      </exceptionManagement>
   </insightSettings>	
</configuration>

4. Please configure the TCP/IP router “hostname” and “port” to where the RI RouterService is being hosted, are matching.

5. That’s it!

Last edited Feb 11, 2014 at 8:39 PM by RSDeveloper, version 12