Creating the push redirector server

Real-time notification is provided by NexJ Server. The nexj-push-redirector_version.zip file contains everything needed to run a standalone instance of the push redirector, including two batch scripts to run the server. The file is bundled with the NexJ CRM release package.

The nexj-push-redirector_version.zip file contains the files required to install and run the push redirector. The file is bundled with the NexJ Studio plugin.

To be authorized by the push server, the push user must be assigned the PushRedirect privilege in the NexJ Admin Console. For more information about assigning privileges, see the NexJ CRM Administrator Guide. In addition, the new user must exist in the application server's authentication domain and have membership in the "nexjusers" group. The Java JDK must also be installed and the JAVA_HOME environment variable must be set to the JDK directory.

For development and testing purposes, run the application from NexJ Studio. Configure the push notification settings in the server or environment file, in the Push Notification subtab of the Overview tab.

For production, use the standalone push redirector with the following steps.

Two files within the bin directory can be used to start the push redirector: run.bat and svc.bat. The run.bat file will immediately start the server and the console will output any status messages. The svc.bat file will add the push redirector as a Windows service, allowing you run the server automatically by configuring the service.

To set up a standalone instance of the push redirector:
  1. Extract the nexj-push-redirector_version.zip to a location of your choice. Inside the archive file are three directories: bin, conf, and deploy.
  2. In the bin directory, edit the desired batch file with a text editor of your choice.
    • If you want to start the push redirector manually, edit run.bat.
    • If you want to add the push redirector as a Windows service, edit svc.bat.
  3. Configure the selected batch file using one of three available methods. The first method is recommended for a production environment. See Push redirector and push server configuration properties for information on each property.
    • Place an environment or server file in the conf directory that contains the settings for the push redirector. This method is recommended for use in a production environment to ensure that the environment file is not overwritten when extracting a new version of the push redirector.
    • Define the CONFIG_FILE variable with the location of a configured environment or server file. If files are also present in the conf directory, the file defined in CONFIG_FILE takes precedence.
    • Define the PUSH_PROPS variable with the settings of each property. Each property must be prefixed with -Dnexj. If files are present in the conf directory or CONFIG_FILE is defined, any properties defined in PUSH_PROPS will overwrite the properties within the environment or server files. Here is a sample definition for PUSH_PROPS:
      set PUSH_PROPS=-Dnexj.pushRedirectorURL="http://localhost:5080/nexj/pushRedirect" -Dnexj.pushServerURLs="http://localhost:8080/nexj/push" -Dnexj.pushUser="nexjsa" -Dnexj.pushPassword="text:nexj"
    Note: If you are deploying without HTTPS and using the PUSH_PROPS method, add the following property:
    -Dnexj.secureTransport="false"
  4. Execute the selected batch file.
    • If you are using run.bat, simply execute the file normally to start the server. No further steps are required.
    • If you are using svc.bat, command line parameters are required to run the program. Follow the steps below to install the service.
    1. Open a command line console and navigate to the bin directory. Enter svc.bat -i to install the push redirector service.
      Note: The svc.bat script works with both 32-and 64-bit versions of Windows. The script will automatically select the correct version, but you can force the script to use settings for the 32-bit version with the x86 parameter, for example:
      svc.bat -i x86
    2. In the command line, enter services.msc to open the Windows services console. Locate the service named PushRedirector and start the service to run the push redirector. Configure the service as desired.
      Note: For increased security, set the Windows service to log on using a local service account with limited privileges. Update the permissions on the directory containing the push redirector files to give the service account Modify permissions.
To confirm that the push redirector is connected to the push server, enter the URL of the push server in a web browser, for example: http://localhost:8080/nexj/push. The URL should bring up a webpage that displays the push redirector URL in plain text. If your connection times out and produces error code 500, then the push redirector is not connected.

A log of the server is created with Apache log4j in the log directory. Configure log settings in conf\log4j.properties.

If you installed the push redirector as a Windows service and want to uninstall it, enter svc.bat -u on the command line.

If you started the server with run.bat, stop the server by selecting the server console and pressing Ctrl + C. Enter Y when asked to terminate the process.