Publishing Framework
Publish to QueuesPublishes a package to one or more message queues. SyntaxCALL PACKAGE_PUBLISH(packageId, publishType, rc, properties, <propValue1, ...propValueN>, queue1<, ...queueN>);
DetailsWhen 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, 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 LDAP URL, an FTP URL, or an HTTP URL, see How to Specify ARCHIVE_PATH for details about specifying archive properties. 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 MQSeries, 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. ExamplesExample 1The following example publishes a package to two queues. One queue is an MQSeries 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. PubType = "TO_QUEUE"; FirstQ = "MQSERIES://PCONE:LOCAL"; SecondQ = "MSMQ://JSMITH:TRANSQ"; CorrValue = "12345678901234567890"; Call PACKAGE_PUBLISH(packageId, pubType, rc, "CORRELATIONID", CorrValue, firstQ, secondQ); Example 2The following example publishes the package to one queue and does not apply any additional queue properties: pubType = "TO_QUEUE"; firstQ = "MQSERIES://PCONE:MYQ"; Call PACKAGE_PUBLISH(packageId, pubType, rc, '', firstQ); Example 3The 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. pubType = "TO_QUEUE"; firstQ = "MQSERIES://PCONE:MYQ"; prop = "ARCHIVE_PATH"; archivePath = "tempfile"; Call PACKAGE_PUBLISH(packageId, pubType, rc, prop, archivePath, firstQ); |