The JNBridge JMS adpter for .NET uses a .NET-to-Java bridge, or transport, between the Java Virtual Machine and the .NET Common Language Runtime. The default transport is shared-memory, however it is possible to configure the adapter to use a socket-based TCP transport. Because the TCP transport allows the JVM to run in its own process, some memory limitations associated with executing the JVM in a thread in the same process as the CLR can be mitigated. These memory limitations, in part due to limitations of the JVM on the Windows platform as well as the JNI specification, may be addressed by using a 64-bit Windows platform and a 64-bit JVM. Alternatively, it is possible to use the -Xms and -Xmx JVM memory management arguments to solve some memory limitations. Please see the Knowledge Base article How to send arguments to the JVM when using the JNBridge JMS adapters for .NET and BizTalk Server. If these two alternatives are untenable, then using the TCP transport may solve some memory limitations.
Using the TCP transport requires adding registry values to the adapter registry key. Please carefully follow these steps. Make sure spelling and case are correct for value names and contents.
- Open up the regedit.exe application and navigate to the key HKEY_LOCAL_MACHINESOFTWAREJNBridgeJMSAdaptersBTS2006 or HKEY_LOCAL_MACHINESOFTWAREJNBridgeJMSAdaptersDotNet depending on the adapter you’re using. There should be an existing value present, InstallationDirectory, pointing to the adapter’s home directory.
- Create a new value of type String and name it TransportType.
- Modify the value. If the value is set to tcp, then the tcp transport is used. If the value is sharedmem, then the default shared-memory transport is used.
Additional values, AutoStart, Hostname and Port allow for configuration of local or remote JVM processes, different port numbers and the ability for the adapter to automatically start and stop the JVM process.
Configuring the TCP transport values
TransportType—This registry value toggles between using shared-memory and the TCP transport. The possible data are:
- tcp Toggles the TCP transport. If the only value created is TransportType and its data is set to tcp, then the adapter will automatically start and configure a JVM process on the machine where the adapter is running. The transport will use the default port of 8085. For the adapter to automatically start a JVM process, the Java bootstrapper, java.exe, must be in the Windows system32 directory. Most JRE installations will place the bootstrapper in system32.
- sharedmem Toggles the shared-memory transport. If shared memory is toggled on, all of the TCP transport configuration values will be ignored.
AutoStart—This registry value allows the adapter to automatically start and stop the JVM process, but only on the local machine. The possible data are:
- true Allows the adapter to manage the JVM process. If the Hostname registry value is used and its data is not localhost, 127.0.0.1 or the name of the local machine, then an exception will be thrown.
- falseThe adapter will not manage the JVM process. In this case, the JVM process must be started by some other mechanism, such as a script. As an example, the following command line in a batch file will start a JVM process using the tcp transport:java -cp “C:virtualPCShareactivemq-all-5.1.0.jar;C:Program FilesJNBridgeJMSAdaptersjnbinbcel-5.1-jnbridge.jar; C:Program FilesJNBridgeJMSAdaptersjnbinjnbcore.jar” com.jnbridge.jnbcore.JNBMain /p javaSide.serverType=tcp /p javaSide.port=8085Note that the -cp argument contains the path to the JMS implementation JAR file as well as two JAR files installed by the adapter, jnbcore.jar and bcel-5.1-jnbridge.jar. The JVM executes the class com.jnbridge.jnbcore.JNBMain with the arguments
/p javaSide.serverType=tcp and /p javaSide.port=8085. The javaSide.serverType argument must always be tcp. The port number for javaSide.port can be changed from the default of 8085. For more information on starting a JVM process see the JNBridgePro Users’ Guide, downloadable from this website. To learn how to start a JVM process as a NT service, see the Knowledge Base article Running the Java side as a service.
If the AutoStart value is not set, then AutoStart is assumed to be true.
Hostname—The host where the JVM process will be running. If this registry value is not created, then the local machine is assumed. If the value AutoStart is set to true, then the data for the Hostname value must be localhost, 127.0.0.1 or the name of the local machine, or an exception will be thrown.
Port—The port number where the JVM process will be listening for a connection from the CLR. If this value is not set, then a default port number of 8085 is assumed. If the JVM process is started manually (AutoStart = false), then this value must be equal to the value for the javaSide.port argument used when starting the JVM process.
The following screen shot shows a configuration for a remote JVM process.