swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
function  

mq-get

 
 

Library: Interfaces, MQSeries access (OMMQI)
Include: ommqi.xin
Return type: String
Returns: 

A string containing the retrieved message body.


Declaration

  define external stream function mq-get
    object               value   mq-object                object
    message-descriptor  value   mq-message-descriptor   MQMD
    get-options         value   mq-get-message-options  MQGMO
    length              value   integer                 max-length

Argument definitions

object
is a mq-object representing a connection to a queue.
MQMD
is a configured mq-message-descriptor object.
MQGMO
is a configured mq-get-message-options object.
length
is the maximum number of bytes in the message we want returned.


Purpose

Use mq-get to retrieve a message from an MQSeries queue.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "ommqi.xin"

The object must be open (else external exception OMMQI0013).

max-length must be greater than or equal to zero (else external exception OMMQI0014).

Usage Notes

This function corresponds to the MQPUT function in the MQSeries API.

The object parameter maps to both the Hconn and Hobj parameters of MQPUT.

The returned stream corresponds to the Buffer parameter of MQPUT.

The CompCode and Reason parameters of MQPUT are integrated into the OMMQI error handling.

Example

Connect to a queue and retrieve the first message.

  include "ommqi.xin"

  process
      local mq-connection       a-connection
      local mq-object               a-object
      local stream                 od-fields   variable
      local mq-object-descriptor   a-mqod
      local mq-message-descriptor  a-mqmd
      local mq-get-message-options a-mqgmo
      local stream                 message

      ; Connect to the MQSeries server using default values
      set a-connection to mq-connect

      ; Connect to the default queue on the server
      set new od-fields {"ObjectName"} to "default"
      mq-set-object-descriptor a-mqod to od-fields
      set a-object to mq-open connection           a-connection
                             object-descriptor a-mqod
                             options           MQOO_INPUT_AS_Q_DEF

      ; Get the first message in the queue, returning at most 1k of data
      set message to mq-get object              a-object
                            message-descriptor a-mqmd
                            get-options        a-mqgmo
                            length             1024

    Related Syntax
   mq-put
   mq-put1message
 
  Other Library Functions
   mq-backout
   mq-close
   mq-commit
   mq-connect
   mq-connection
   mq-connectx
   mq-disconnect
   mq-get
   mq-get-entire-return-status
   mq-get-function-status
   mq-get-logging-level
   mq-get-throw-on-warnings
   mq-inquire
   mq-inquire-names
   mq-object
   mq-open
   mq-put
   mq-put1message
   mq-set
   mq-set-logging-level
   mq-set-throw-on-warnings
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:31 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.