Enable NSQ Messaging

EMS Cloud Services Customers

The configuration information in this topic does not apply to EMS Cloud Services customers. For more information regarding the configuration of EMS software with Cloud Services, please refer to the EMS Cloud Services documentation.

NSQ Messaging Type must be enabled to use EMS for Google Calendar or EMS for Microsoft Exchange (Exchange-to-EMS sync option). NSQ Messaging Type is a feature built within EMS Platform Services. Once NSQ is enabled, no additional software installation is required for NSQ.

To enable NSQ Messaging Type, follow the instructions below based on the type of environment where EMS Platform Services is installed:

Environments with a Single Application Server

For environments with a single application server where EMS Platform Services is installed, add the following environment variables to the web.config file for the application:

<environmentVariable name="ems_messaging_type" value="nsq" />

<environmentVariable name="TMP" value="C:\inetpub\wwwroot\Platform2wLogs" />

All environment variables added to the Platform Services web.config should be added inside the aspNetCore section and grouped between lines to open and close the section with:



To enable NSQ, you must add an "ems_messaging_type" variable (note that the value MUST be lower case) and a "TMP" variable, as seen below. Note that the value specified for "TMP" is a folder that must be created on the server and must be a folder that is not overwritten by the OS (for example c:\temp is not a good choice here) and must be writable by Platform Services (typically by adding write and modify access for the folder to the IIS_IUSRS user under the folder properties > security tab).


If using a version later than EMS 44.1.35, you don't need <environmentVariable name="ems_messaging_type" value="nsq" />. You can remove it if previously added.

An example for Update 34:

<?xml version="1.0" encoding="UTF-8"?>




<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>


<aspNetCore processPath="./restapi.exe" arguments="" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="true">


<environmentVariable name="ems_messaging_type" value="nsq" />

<environmentVariable name="TMP" value="C:\inetpub\wwwroot\PlatformNSQLogs" />






From Update 35 and later, the value "nsq" is no longer case-sensitive.

Environment with Multiple Nodes Behind a Load Balancer

For environments with multiple nodes behind a load balancer, you must configure additional environment variables to successfully enable NSQ. The IP addresses or hostnames used will depend on those assigned to each node.

Example—Enabling NSQ in a Three Node Environment

For this example, the following instructions will assume a three-node environment: Node A, Node B, and Node C. You will need to complete the same type of configuration for every node within the cluster. For the NSQ to function properly, the EMS Platform Services instances need to know where each other are located on the network.

In the following example,, HOSTNAME-A, HOSTNAME-B, and HOSTNAME-C are for demonstration purposes only.

Web.config Environment Variables for Example Node A:


Set the variables EMS_MESSAGING_NSQ_TCPAddr and EMS_MESSASGING_NSQ_HTTPAddr to an internal IP address assigned to the server running EMS Platform Services for which the current web.config is being edited. The IP address should be actually assigned to the machine, but not necessarily reachable. Using the Node A example, this configuration would reference the internal IP for Node A—

<environmentVariable name="EMS_MESSAGING_NSQ_TCPAddr" value="" />
<environmentVariable name="EMS_MESSASGING_NSQ_HTTPAddr" value="" />
EMS_MESSAGING_NSQ_BroadcastAddr Variable

Set the variable EMS_MESSAGING_NSQ_BroadcastAddr to an internal IP or a hostname (that is assigned to an internal IP) that other instances of EMS Platform Services can use to reach this one—set to the reachable hostname for Node A at which other nodes can reach it. The EMS_MESSAGING_NSQ_BroadcastAddr variable is only required if the reachable address is different from EMS_MESSAGING_NSQ_TCPAddr and EMS_MESSASGING_NSQ_HTTPAddr, which can happen due to the server being behind a NAT router, for example.

<environmentVariable name="EMS_MESSAGING_NSQ_BroadcastAddr" value="HOSTNAME-A" />
EMS_MESSAGING_NSQ_AdditionalNSQDAddrs and EMS_MESSAGING_NSQ_AdditionalLookupdAddrs Variables

Set the variables EMS_MESSAGING_NSQ_AdditionalNSQDAddrs and EMS_MESSAGING_NSQ_AdditionalLookupdAddrs to the broadcast IP addresses or hostnames of the other nodes within the cluster, as defined by the EMS_MESSAGING_NSQ_BroadcastAddr variable in the web.config for each EMS Platform Services instance. Each variable should exist only once per web.config with the value for the variable containing all the values within the cluster (comma separated with no spaces within the string).

<environmentVariable name="EMS_MESSAGING_NSQ_AdditionalNSQDAddrs" value="HOSTNAME-B,HOSTNAME-C" />
<environmentVariable name="EMS_MESSAGING_NSQ_AdditionalLookupdAddrs" value="HOSTNAME-B,HOSTNAME-C" />

NSQ uses four ports on every node in the cluster and these ports must be open on each: 4150,4151,4160,4161