JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server Message Queue 4.5 Developer's Guide for C Clients
search filter icon
search icon

Document Information

Preface

1.  Introduction

2.  Using the C API

Message Queue C Client Setup Operations

To Set Up a Message Queue C Client to Produce Messages

To Set Up a Message Queue C Client to Consume Messages Synchronously

To Set Up a Message Queue C Client to Consume Messages Asynchronously

Working With Properties

Setting Connection and Message Properties

To Set Properties for a Connection

Getting Message Properties

To Iterate Through a Properties Handle

Working With Connections

Defining Connection Properties

Connection Handling

Reliability

Flow Control

Working With Secure Connections

Configuring the Client for Secure Communication

Verification Using Fingerprints

Coordinating NSS Initialization

Shutting Down Connections

Working With Sessions and Destinations

Creating a Session

Transacted Sessions

Message Acknowledgement

Receive Mode

Managing a Session

Creating Destinations

Programming Domains

Auto-Created Destinations

Temporary Destinations

Getting Information About Destinations

Working With Messages

Composing Messages

Message Header

Message Body Types

Composing the Message

Sending a Message

Receiving Messages

Working With Consumers

Receiving a Message Synchronously

Receiving a Message Asynchronously

Processing a Message

Working With Distributed Transactions

Message Queue Resource Manager Information

Programming Examples

Error Handling

To Handle Errors in Your Code

Memory Management

Logging

3.  Client Design Issues

4.  Reference

A.  Message Queue C API Error Codes

Index

Error Handling

Nearly all Message Queue C functions return an MQStatus result. You can use this return value to determine whether the function returned successfully and, if not, to determine the cause of the error.

Table 2-13 lists the functions you use to get error information.

Table 2-13 Functions Used in Handling Errors

Function
Description
Returns an MQ_TRUE if the specified MQStatus is an error.
Returns the error code for the specified MQStatus.
Returns a descriptive string for the specified MQStatus.
Returns the calling thread’s current error trace or NULL if no error trace is available.

To Handle Errors in Your Code

  1. Call MQStatusIsError, passing it an MQStatus result for the function whose result you want to test.
  2. If the MQStatusIsError function returns MQ_TRUE , call MQGetStatusCode or MQGetStatusString to identify the error.
  3. If the status code and string information is not sufficient to identify the cause of the error, you can get additional diagnostic information by calling MQGetErrorTrace to obtain the calling thread’s current error trace if this information is available.

    Chapter 4, Reference, lists common errors returned for each function. In addition to these errors, the following error codes may be returned by any Message Queue C function:

    • MQ_STATUS_INVALID_HANDLE

    • MQ_OUT_OF_MEMORY

    • MQ_NULL_PTR_ARG

    In addition, the MQ_TIMEOUT_EXPIRED can return from any Message Queue C function that communicates with the Message Queue broker if the connection MQ_ACK_TIMEOUT_PROPERTY is set to a non-zero value.