MSMQ Send Service

The MSMQ Send service sends messages to a remote Microsoft® Message Queue.

The following table provides an overview of the MSMQ Send service:

Category Description
System name MSMQ Send Service
Graphical Process Modeler (GPM) categories All Services
Description Sends messages to a remote Microsoft® Message Queue. Sends a message from a business process to a named queue on a specified Microsoft Windows® MSMQ server. The MSMQ Send service also returns pertinent message metadata to the business process after sending the message.
Business usage Use the MSMQ Send Service to send a message to a remote Microsoft® Message Queue.
Preconfigured? Yes
Requires third party files? Yes. Requires msmqbundle_xxx.jar file. Sterling B2B Integrator installation includes msmqbundle_xxx.jar file in the <INSTALL_DIR>/client/msmq folder.
Platform availability All supported Sterling B2B Integrator platforms
Related services N/A
Application requirements Requirements:
  • The connection from Sterling B2B Integrator to the system where the MSMQ server resides.
  • The port number of the system where the MSMQ server resides. This port number is used by the MSMQ Send service.
  • The queue must be preconfigured in the MSMQ server. This queue name is used by the MSMQ Send service. The queue can be transactional or non-transactional, depending on how you need to use the MSMQ Send service.
Initiates business processes? No
Invocation This service is invoked from a business process.
Returned status values
Returned status values:
  • Success - The run was successful for the specified action
  • Error - An error occurred when the specified action was executed
Restrictions Restrictions:
  • The MSMQ Send service supports MSMQ version 1.1 and later. The MSMQ Send service supports 40-bit encryption for versions 1.1 and later and 128-bit encryption in versions 2.0 and later.
  • The MSMQ Send service supports single message transactions for guaranteed exactly-once delivery of messages. Other transaction modes are not supported.
  • The MSMQ Send service supports external transactions to MSMQ; that is, a transaction from Application for a SEND action. This only applies to transactional queues in MSMQ.
  • The MSMQ Send service does not support MSMQ acknowledgements.
Persistence level System Default (Full)

Implementing the MSMQ Send Service

To implement the MSMQ Send service, complete the following tasks:
  1. Activate your license for the MSMQ Send service. For more information, see An Overview of Implementing Services.
  2. Install the MSMQPrime component. For information on installing MSMQPrime, see Installing MSMQPrime.
  3. Create and configure an MSMQ Send service configuration. For general instructions on creating a service configuration, see Creating a Service Configuration. For descriptions of the MSMQ Send service configuration parameters, see Configuring the MSMQ Send Service.
  4. Use the MSMQ Send service in a business process.

Installing MSMQPrime

A component of the MSMQ adapter, MSMQPrime, is deployed on the host where the MSMQ server resides. The MSMQ adapter connects to the MSMQPrime component, which in turn, performs the send and receive actions and interacts with the MSMQ server. MSMQPrime listens on the port that is part of the MSMQ adapter configuration.

To install MSMQPrime, complete the following tasks:
  1. Locate msmqbundle_xxx.jar in Sterling B2B Integrator under <INSTALL_DIR>/client/msmq folder.
  2. On the Windows MSMQ server host, create a folder for MSMQPrime. For example, C:\MSMQ.
  3. Copy msmqbundle_xxx.jar to the folder you just created.
  4. Change directory to that folder, and unbundle the .jar file.
  5. Install the Java jdk version 1.6.0. Note the installation path.
  6. Modify start_msmqPrime.cmd to use the folder you created in step 2. Set the MSMQADAPTER parameter to the folder you created in step 2. Set the JAVA parameter to point to the bin directory in the Java path created in step 7 (C:\jdk1.6.0\bin).

    Note: If Java is installed in the default installation folder in C:\Program Files\Java\jdk1.6.0, you have to reference it as C:\Progra~1\Java\jdk1.6.0\bin.
  7. Change MSMQ_SERVER_PORT in, if necessary. The default is 8085. This is the port msmqPrime will run on.

  8. Run start_msmqPrime.cmd. This script should be run by the user who has permission to create queues, read, and send messages to the MSMQ server. This process must be running continually if your MSMQ adapter needs to access it. It is recommended to convert it to an automatically started Windows service.

  9. Create a configuration of the MSMQ adapter in Sterling B2B Integrator and configure it to point to this msmqPrime.

  10. Configure a service instance of MSMQ adapter in Sterling B2B Integrator to point to this msmqPrime.
  11. Verify that the MSMQ adapter configuration is talking to this msmqPrime by including it in a business process and running it.

  12. If desired for testing purposes, turn on debug mode in msmqPrime with the following command by passing -debug as an argument to MSMQPrimaImpl in start_msmq.cmd. The debugon option generates detailed logs.

    Note: The msmqbundle_xxx.jar you use to create the MSMQPrime component must be from the same Sterling B2B Integrator installation as the MSMQ adapter that it will talk to. You need to redeploy the msmqbundle_xxx.jar to the Windows MSMQ server host when a Sterling B2B Integrator patch is installed. This ensures the new code changes are synchronized with MSMQPrime.

Installing MSMQPrime as a Windows Service

To install MSMQPrime as a Windows Service, complete the following tasks:
  1. Unbundle the msmqbundle_xxx.jar file. A directory called installJavaService is created.
  2. Modify the installJavaService\InstallJavaService.cmd script to set the JAVA parameter to the bin directory in the Java path created in step 7 of installing the MSMQPrime component. Set the MSMQINSTALLDIR parameter to the folder created in step 2 of installing the MSMQPrime component.

  3. If you want to turn on the debug mode in msmqPrime, set the PARAMS to debug. By default, debug is turned off.

  4. Copy the file into the installJavaService folder. You can change MSMQ_SERVER_PORT in, so this msmqPrime will run on this port. The default port is 8085.

  5. Run installJavaService.cmd to install MSMQPrime as a Windows service.
  6. To start the service, from the Windows Services applet, select the New MSMQ Send service and select Start.

  7. To stop the service, from the Windows Services applet, select the New MSMQ Send service and select Stop.

Uninstalling MSMQPrime as a Windows Service

To uninstall MSMQPrime as a Windows Service, run the following command:


Configuring the MSMQ Send Service

To configure the MSMQ Send service, you must specify settings for the following fields:

Field Description
Name Unique and meaningful name for the service configuration. Required.
Description Meaningful description for the service configuration, for reference purposes. Required.
Select a Group Select one of the following options:
  • None – You do not want to include this configuration in a group at this time.
  • Create New Group – You can enter a name for a new group in this field, which will then be created along with this configuration.
  • Select Group – If you have already created one or more groups for this service type, they are displayed in the list. Select a group from the list.
Note: For more information about groups, see Managing Services and Adapters.
Remote Host Name Host name of the MSMQ server with which this configuration of the server communicates and where the MSMQPrime is installed. Required.
Port Number Of Remote Host The port number of the MSMQPrime host. Required. Default value is 8085.
Queue Path Name Typical queue path name configured in the MSMQ server in the form Hostname\queueName. Optional.
Document Storage Type Indicate whether the message should be stored on the file system or in the database. Select one of the following options:
  • System Default
  • Database
  • File System
Required. Default value is System Default.

GPM Configuration

The following table describes the parameters you need to specify for configuring MSMQ Send service in the GPM:

Field Description
Action Specifies the type of action. Valid value is Send. Default value is Send. Required.
BodyType Valid values are Byte array and String (default). Optional.
Delivery Valid values are Express and Recoverable (default). Optional.
EncryptionAlgorithm Valid values are CALG_RC2 and CALG_RC4. Optional.
EX_TRANSACTION Indicates whether to include send action in the Sterling B2B Integrator engine transaction. Valid values are True and False. Default value is False. Required.
MaxTimeToReachQueue Maximum time allowed for a message to reach its destination. Default is 300 seconds. Optional.
MessageLabel Label for message being sent to queue. Optional.
MessagePriority Valid values are 0 - 7, where 7 represents the highest priority messages in the queue. The highest priority messages are received first. Default is 3. Optional.
Note: This parameter setting does not apply to messages sent to a transactional queue, which will always have a message priority of 0.
PrivacyLevel Used to request encryption. Valid values are None (default), Base (40-bit) and Enhanced (128-bit, supported in MSMQ version 2.0 and later). Optional.

Output from Service to Business Process

The following table contains the parameter passed from the MSMQ Send service to the business process:

Field Description
MSMQ_CORRELATIONID ID number used to correlate related messages. Optional.

Business Process Example

The following example business process illustrates using the MSMQ Send service:

<process name = "MSMQ_Base"> 
  <sequence name="Test Sequence">
    <operation name="MSMQ Commn">
     <participant name="MSMQSend"/>
     <output message="outmsg">
        <assign to="Action">SEND</assign>
        <assign to="PortNumber">8085</assign>
        <assign to="QueuePathName">lando.labsci.local\testqueuetx</assign>
       <assign to="MaxTimeToReachQueue">3600</assign>
       <assign to="MessagePriority">3</assign>
       <assign to="Delivery">RECOVERABLE</assign>
       <assign to="PrivacyLevel">Base</assign>
       <assign to="MessageLabel">Base</assign>
       <assign to="BodyType">BYTE ARRAY</assign>
       <assign to="GIS_TRANSACTION">TRUE</assign>
       <assign to="." from="*" />
      <input message="inmsg">
       <assign to="." from="*" />