PACKAGE_PUBLISH (Publish Package to Queues)

Publishes a package to one or more message queues

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties,
<propValue1, ...propValueN> , queue1<, ...queueN> );

Required Arguments

packageID
identifies the package that is to be published.
Type:Numeric, Input
publishType
indicates how to publish the package. To publish the package by using the queue transport, specify a publishType of TO_QUEUE.
Type:Character, Input
rc
receives a return code.
Type:Numeric, Output
properties
identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:
  • ARCHIVE_NAME
  • ARCHIVE_PATH
  • CORRELATIONID
  • FTP_PASSWORD
  • FTP_USER
  • HTTP_PASSWORD
  • HTTP_PROXY_URL
  • HTTP_USER
Type:Character, Input
queue1 <, …queueN>
character string that specifies the queue(s) that will be used to publish the package. When publishing to MSMQ queues, use the following syntax:
MSMQ://queueHostMachineName\queueName
When publishing to IBM WebSphere MQ queues, use the following syntax:
MQSERIES://queueManager:queueName
or
MQSERIES-C://queueManager:queueName
MQSERIES specifies the server interface that is used to connect to a queue manager that is local. MQSERIES-C specifies the client interface that is used, allowing the queue manager to be local or remote.
Type:Character, Input

Optional Argument

propValue1, …propValueN
specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter. Valid property values are defined as follows:
ARCHIVE_NAME specifies a character string that indicates the name of the archive file.
ARCHIVE_PATH specifies a character string that indicates the path where the archive should be created.
CORRELATIONID specifies a binary character string correlator that is used on the package header message.
FTP_PASSWORD indicates the password that is needed to log on to the remote host at which the archive will be stored. Specify this property only when the remote host is secured.
FTP_USER indicates the user ID that is needed to log on to the remote host at which the archive will be stored. Specify this property only when the remote host is secured.
HTTP_PASSWORD indicates the password that is needed to bind to the Web server on which the package is published. Specify this property only when the Web server is secured.
HTTP_PROXY_URL indicates the URL of the proxy server.
HTTP_USER indicates the user ID that is needed to bind to the Web server on which the package is published. Specify this property only when the Web server is secured.
Type:Character or Numeric, Input

Details

When publishing to a queue, all entries in the package are published to the queue by default. To override this default, specify the ARCHIVE_PATH property, which indicates that an archive is to be created and only the archive will be published to the queue. The archive will contain all package entries.
If you specify a value for ARCHIVE_PATH, then the archive is stored at the designated location. To create a temporary archive that is deleted after the package is published, specify an ARCHIVE_PATH value of "" or "tempfile".
If you specify ARCHIVE_PATH as an FTP URL or as an HTTP URL, and need details about specifying archive properties, see PACKAGE_PUBLISH (Publish Package to Archive).
Note: In the z/OS operating environment, you can publish archives only to UNIX System Services directories.
Queues that support transactional units of work are recommended. By using these types of queues, the queue transport prevents partial packages from remaining on the queue in cases where errors are encountered during package publishing. For MSMQ, this means that the queue should be transactional. For IBM WebSphere MQ, this means that the queue should support synchronization points.
When you specify the CORRELATIONID property, the package message uses the specified CORRELATIONID value. You can retrieve packages from the queue by correlation ID.

Examples

Example 1: Using PACKAGE_PUBLISH to Publish to Two Queues with the CORRELATIONID Property

The following example publishes a package to two queues. One queue is an IBM WebSphere MQ queue that is named PCONE; the second queue is an MSMQ queue that is specified by the queue manager, who is named JSMITH. A CORRELATIONID of 12345678901234567890 is assigned to the package to be published to both queues.
publishType = "TO_QUEUE";
FirstQ = "MQSERIES://PCONE:LOCAL";
SecondQ = "MSMQ://JSMITH:TRANSQ";
CorrValue = "12345678901234567890";
CALL PACKAGE_PUBLISH(packageId, publishType, rc,
   "CORRELATIONID", CorrValue, firstQ, secondQ);

Example 2: Using PACKAGE_PUBLISH to Publish to a Queue

The following example publishes the package to one queue and does not apply any additional queue properties:
publishType = "TO_QUEUE";
firstQ = "MQSERIES://PCONE:MYQ";
CALL PACKAGE_PUBLISH(packageId,
   publishType, rc, '', firstQ);

Example 3: Using PACKAGE_PUBLISH to Publish an Archive to a Queue with the ARCHIVE_PATH Property

The following example creates an archive and publishes it to a queue. The ARCHIVE_PATH property is specified as "tempfile". After the archive is published to the queue, the temporary, local copy is deleted automatically. The archive contains all entries that are inserted into the package.
publishType = "TO_QUEUE";
firstQ = "MQSERIES://PCONE:MYQ";
prop = "ARCHIVE_PATH";
archivePath = "tempfile";
CALL PACKAGE_PUBLISH(packageId, publishType,
   rc, prop, archivePath, firstQ);