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

Working With Distributed Transactions

In accordance with the X/Open distributed transaction model, Message Queue C-API support for distributed transactions relies upon a distributed transaction manager. The distributed transaction manage tracks and manages distributed transactions, coordinating the decision to commit them or roll them back, and coordinating failure recovery. The Message Queue C-API supports the X/Open XA interface, qualifying it as an XA-compliant resource manager. This support allows C-API clients running in a distributed transaction processing environment to participate in distributed transactions.

In particular, two C-API functions support the participation of C-API clients in distributed transactions:

MQGetXAConnection()
MQCreateXASession()

If a C-client application is to be used in the context of a distributed transaction, then it must obtain a connection by using MQGetXAConnection() and create a session for producing and consuming messages by using MQCreateXASession(). The start, commit, and rollback, of any distributed transaction is managed by the distributed transaction manager.

For more information on XA resource managers, see the XA Specification.

Message Queue Resource Manager Information

In accordance with the X/Open XA interface specification, a distributed transaction manager needs the following information regarding the Message Queue XA-compliant resource manager:

The following name/value pairs are supported:

Table 2-12 Message Queue Resource Manager Name/Value Pairs

Name
Value
Description
Default
address
host:port
The host:port of the broker's Portmapper service.
localhost:7676
username
string
The username for connecting to the broker
guest
password
string
The username's password
guest
conntype
TCP or SSL
The protocol type of the connection to the broker
TCP
trustedhost
true/false
Whether the broker host is trusted (only applicable for conntype=SSL)
true
certdbpath
string
The full path to the directory that contains NSS certificate and key database files
not set
clientid
string
Required only for JMS durable subscriptions
not set
reconnects
integer
The number of re-connection attempts to broker (0 means no reconnect)
0

Programming Examples

To help you program an application that uses distributed transactions, Message Queue provides programming examples based on the Tuxedo distributed transaction manager. A description of the sample programs and their location is provided in Table 1-3.