Ibm Web MQ CPP
Ibm Web MQ CPP
Version 2.0.1
SC34-6984-01
Note!
Before using this information and the product it supports, be sure to read the general information under “Notices,” on page
477.
This edition applies to IBM Message Service Client for C/C++, Version 2.0.1 and to any subsequent releases and
modifications until otherwise indicated in new editions.
This edition replaces SC34-6984-00.
Parts of the specification of the API provided by Message Service Client for C/C++ are
derived from the following sources:
The Java Message Service Specification, Version 1.1
Copyright 2002 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California 94303, U.S.A.
All rights reserved.
Package javax.jms (JMS 1.1 API specification)
Copyright 2002 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California 94303, U.S.A.
All rights reserved.
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Contents v
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
ErrorBlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
ExceptionListener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
InitialContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
MapMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
MessageConsumer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
MessageListener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
MessageProducer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
ObjectMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Property . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
PropertyContext . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
QueueBrowser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
Requestor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
StreamMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
TextMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
Contents vii
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Inherited methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Constructors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
TextMessage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Inherited methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
TransactionInProgressException . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Inherited methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
TransactionRolledBackException . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Inherited methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Contents ix
XMSC_WMQ_SSL_CIPHER_SUITE . . . . . . . . . . . . . . . . . . . . . . . . . . 459
XMSC_WMQ_SSL_CRYPTO_HW. . . . . . . . . . . . . . . . . . . . . . . . . . . 460
XMSC_WMQ_SSL_FIPS_REQUIRED . . . . . . . . . . . . . . . . . . . . . . . . . 461
XMSC_WMQ_SSL_KEY_REPOSITORY . . . . . . . . . . . . . . . . . . . . . . . . . 461
XMSC_WMQ_SSL_KEY_RESETCOUNT . . . . . . . . . . . . . . . . . . . . . . . . 462
XMSC_WMQ_SSL_PEER_NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
XMSC_WMQ_SYNCPOINT_ALL_GETS . . . . . . . . . . . . . . . . . . . . . . . . 463
XMSC_WMQ_TARGET_CLIENT . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
XMSC_WMQ_TEMP_Q_PREFIX . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
XMSC_WMQ_TEMP_TOPIC_PREFIX . . . . . . . . . . . . . . . . . . . . . . . . . 464
XMSC_WMQ_TEMPORARY_MODEL . . . . . . . . . . . . . . . . . . . . . . . . . 464
XMSC_WMQ_WILDCARD_FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . 464
XMSC_WPM_BUS_NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
XMSC_WPM_CONNECTION_PROTOCOL . . . . . . . . . . . . . . . . . . . . . . . 465
XMSC_WPM_CONNECTION_PROXIMITY . . . . . . . . . . . . . . . . . . . . . . . 466
XMSC_WPM_DUR_SUB_HOME . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
XMSC_WPM_HOST_NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
XMSC_WPM_LOCAL_ADDRESS. . . . . . . . . . . . . . . . . . . . . . . . . . . 467
XMSC_WPM_ME_NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
XMSC_WPM_NON_PERSISTENT_MAP . . . . . . . . . . . . . . . . . . . . . . . . 468
XMSC_WPM_PERSISTENT_MAP . . . . . . . . . . . . . . . . . . . . . . . . . . 468
XMSC_WPM_PORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
XMSC_WPM_PROVIDER_ENDPOINTS . . . . . . . . . . . . . . . . . . . . . . . . 469
XMSC_WPM_SSL_CIPHER_SUITE . . . . . . . . . . . . . . . . . . . . . . . . . . 470
XMSC_WPM_SSL_KEY_REPOSITORY . . . . . . . . . . . . . . . . . . . . . . . . . 471
XMSC_WPM_SSL_KEYRING_LABEL . . . . . . . . . . . . . . . . . . . . . . . . . 471
XMSC_WPM_SSL_KEYRING_PW . . . . . . . . . . . . . . . . . . . . . . . . . . 471
XMSC_WPM_SSL_KEYRING_STASH_FILE . . . . . . . . . . . . . . . . . . . . . . . 472
XMSC_WPM_SSL_FIPS_REQUIRED . . . . . . . . . . . . . . . . . . . . . . . . . . 472
XMSC_WPM_TARGET_GROUP . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
XMSC_WPM_TARGET_SIGNIFICANCE . . . . . . . . . . . . . . . . . . . . . . . . 473
XMSC_WPM_TARGET_TRANSPORT_CHAIN . . . . . . . . . . . . . . . . . . . . . . 473
XMSC_WPM_TARGET_TYPE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
XMSC_WPM_TEMP_Q_PREFIX . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
XMSC_WPM_TEMP_TOPIC_PREFIX . . . . . . . . . . . . . . . . . . . . . . . . . 474
XMSC_WPM_TOPIC_SPACE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
For the latest information about Message Service Client for C/C++, see the product
readme.txt file, which is supplied.
The term XMS client refers to an installed instance of Message Service Client for
C/C++ that supports an application.
The term WebSphere MQ JMS refers to WebSphere MQ classes for Java Message
Service.
WebSphere JMS is used as a general term for any of the following JMS
implementations:
v WebSphere MQ JMS
v JMS for the WebSphere default messaging provider
Messaging server is used as a general term for any of the following software
components:
v A WebSphere MQ queue manager
v A broker of WebSphere Business Integration Event Broker or WebSphere
Business Integration Message Broker
v A WebSphere service integration bus
Unless otherwise stated, or implied by the context, broker is used as a general term
for a broker of any of the following products:
v WebSphere MQ Publish/Subscribe, as supplied with WebSphere MQ
v WebSphere Business Integration Event Broker
v WebSphere Business Integration Message Broker
You can download the latest edition of WebSphere MQ Using Java from
http://www.ibm.com/software/integration/mqfamily/library/manualsa/ .
You can access the latest version of the information center for WebSphere Business
Integration Event Broker or WebSphere Business Integration Message Broker at
http://publib.boulder.ibm.com/infocenter/wbihelp/ .
You can access the latest version of the information center for WebSphere
Application Server at http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/
index.jsp .
IPv6 Support
This release of IBM Message Service Client for C/C++ enables XMS applications
developed using C or C++ programming language to connect to Messaging
Servers, such as WebSphere MQ, WebSphere SIB, and WebSphere Message Broker
running on an Internet Protocol version 6 (IPv6) enabled network.
The XMS applications, however, will continue to run on IPv4 networks. Users who
have only IPv4 stack and no IPv6 stack configured, may continue to use IPv4. See
“Network stack selection mechanism” on page 58 for details.
With the release of version 2.0.1, XMS adds two new properties for the Message
object. These properties are JMS_IBM_ArmCorrelator and
JMS_TOG_ARM_Correlator. These properties enable associating a unique
enterprise-wide Id for data being exchanged between disparate applications
running in complex, heterogenous environment of large enterprises.
These two properties are synonyms. Thus, applications can set the property with
one name and retrieve the same with the other property name. The use of
JMS_TOG_ARM_Correlator is however preferred over the use of
JMS_IBM_ArmCorrelator.
Performance enhancements
Publish/subscribe messaging
Message Service Clients for C/C++ applications can use the embedded
publish/subscribe function, and can use it instead of using WebSphere Event
Broker or WebSphere Message Broker for publish/subscribe messaging with
WebSphere MQ as the transport. Configuring Message Service Clients for C/C++
to use the new function is simpler than configuring Message Service Clients for
C/C++ to use WebSphere MQ Publish/Subscribe, WebSphere Event Broker, or
WebSphere Message Broker. Administrators and application developers no longer
need to manage publication queues, subscriber queues, subscription stores, and
subscriber cleanup.
The WebSphere MQ messaging provider normal mode uses all the features of the
WebSphere MQ Version 7.0 queue managers to implement JMS. This mode is used
only to connect to a WebSphere MQ queue manager and can connect to WebSphere
MQ Version 7.0 queue managers in either client or bindings mode. This mode is
optimized to use the new WebSphere MQ Version 7.0 function. The WebSphere
MQ messaging provider migration mode is based on WebSphere MQ Version 6.0
Message Service Clients for C/C++ has been changed to exploit this new feature in
WebSphere MQ V7.0. The implementation of XMS message listeners is now a more
natural fit with WebSphere MQ, and Message Service Clients for C/C++ no longer
has to poll a destination to check whether a suitable message has been sent to the
destination. The performance of XMS message listeners is improved as a result,
particularly when an application uses multiple message listeners in a session to
monitor multiple destinations. Message throughput is increased, and the time
taken to deliver a message to a message listener after it has arrived at a destination
is reduced.
Message selection
Message Service Clients for C/C++ exploits this enhancement. For an application
that connects to a queue manager in client mode, Message Service Clients for
C/C++ might create more than one connection to a queue manager using the MQI
channel whose name is specified as a property of the ConnectionFactory object.
Each of these connections to the queue manager can now share a single TCP
connection.
When deciding whether to use read ahead, consider the following points:
v If an application is consuming messages from a destination that is configured for
read ahead, and the application ends for any reason, any nonpersistent messages
that are currently stored in the buffer are discarded.
v If all the following conditions are true, messages sent to a queue in a session
might not be received in the order in which they were sent:
– An application uses two message consumers in the same session to consume
the messages from the queue.
– Each message consumer uses a different Destination object for the queue.
– Any or both of the Destination objects are configured for read ahead
Reading and writing the message descriptor from a Message Service Clients for
C/C++ application
You can now access the message descriptor (MQMD) of a WebSphere MQ message.
This feature is available only when connecting to a WebSphere MQ queue manager
version 6 and above and is controlled by destination properties described later.
All MQMD fields are exposed except StrucId and Version; BackoutCount can be
read but not written to.
Message Service Clients for C/C++ provides message attributes that allow XMS
applications to set MQMD fields and so enable XMS applications to drive
WebSphere MQ applications.
You can access the complete WebSphere® MQ message data including the
MQRFH2 header (if present) and any other WebSphere MQ headers (if present)
within a Message Service Clients for C/C++ application as the body of a
JMSBytesMessage.
Destination object properties determine how the XMS application accesses the
whole of a WebSphere MQ message (including the MQRFH2 header, if present) as
the body of a JMSBytesMessage..
An XMS application can connect to, and use the resources of, any of the following
messaging servers:
v A WebSphere MQ queue manager.
The application can connect in either bindings or client mode.
v A WebSphere service integration bus.
The application can use a direct TCP/IP connection, or it can use HTTP over
TCP/IP.
v A broker of WebSphere Event Broker or WebSphere Message Broker.
Messages are transported between the application and the broker using
WebSphere MQ Real-Time Transport and, depending on the configuration,
messages can be delivered to the application using WebSphere MQ Multicast
Transport.
An XMS application can exchange messages with any of the following types of
application:
v An XMS application
v A WebSphere MQ JMS application
v A native WebSphere MQ application
v A JMS application that is using the WebSphere default messaging provider
The following list summarizes the main XMS classes, or types of object:
ConnectionFactory
A ConnectionFactory object encapsulates a set of configuration parameters
for a connection. An application uses a ConnectionFactory to create a
connection. An application can create a ConnectionFactory object at run
ConnectionFactory
Creates
Connection
Creates
Creates Creates
MessageProducer Session MessageConsumer
XMS applications written in C++ use these classes and their methods. XMS
applications written in C use the same object model even though C is not an object
oriented language. When a C application calls a function to create an object, XMS
The XMS object model is based on the domain independent interfaces that are
described in Java Message Service Specification, Version 1.1. Domain specific classes,
such as Topic, TopicPublisher, and TopicSubscriber, are not provided.
Administered objects
Using administered objects, you can administer the connection settings used by
client applications to be administered from a central repository. An application
retrieves object definitions from the central repository and uses them to create
ConnectionFactory and Destination objects. This allows applications to be
de-coupled from the resources that they use at runtime.
For example, XMS applications can be written and tested with administered objects
that reference a set of connections and destinations in a test environment. When
the applications are deployed, the administered objects can be changed to point the
applications to a production environment.
The following diagram shows how an XMS application typically uses administered
objects.
Produces/consumes
Administers Looks up
messages
Destination
ConnectionFactory
In particular, XMS implements the same message header fields and message
properties that WebSphere JMS implements:
v JMS header fields. These are fields whose names commence with the prefix JMS.
v JMS defined properties. These are properties whose names commence with the
prefix JMSX.
v IBM defined properties. These are the properties whose names commence with
the prefix JMS_IBM_.
Operating environments
An XMS client is supplied for each of the tested operating systems.
Note: XMS on Sun Solaris has been built and tested using both the Forte
Developer 6 Update 2 C and C++ compilers. The version of the C compiler
and the C++ compiler itself are both version 5.3.
The XMS C libraries are readily usable with objects built with earlier or later
versions of the Sun Studio C compilers.
The XMS C++ libraries are readily usable with later 5.x versions of the Sun
Studio C compilers. Note that the XMS C++ libraries are likely to be
unusable with objects built by a C++ compiler with version earlier than 5.x,
or with 5.x compilers operating in version 4 compatibility mode. Therefore,
if an object has been compiled by a version 5.x compiler specifying the
-compat option, it is likely to be unusable, either at link time or run time,
with the XMS C++ libraries.
For applications that connect to a WebSphere MQ queue manager, you must install
the appropriate WebSphere MQ client libraries on the machine you use to run the
XMS application. These libraries are pre-installed on machines with a local queue
manager.
For XMS client for C/C++, use the WebSphere MQ Version 7.0.0.1 client libraries.
These enable client mode connections to WebSphere MQ Version 7.0, and
WebSphere MQ Version 6.0, and WebSphere MQ Version 5.3 queue managers and
bindings mode connections to WebSphere MQ Version 7.0 local queue managers.
XMS client for C/C++ can still work with WebSphere MQ Version 7.0.0.0 client
libraries but will not be able to use WebSphere MQ Version 7.0 features.
Note: When you are installing on Windows using the installation wizard, you can
choose the location in which GSKit is installed.
The installed client requires 150 MB of disk space on AIX, Linux, Solaris, and
Windows.
To install Message Service Client for C/C++ on AIX, Linux, Solaris, or Windows,
follow this procedure. You can click Cancel at any time during the install setup
process to stop the installation process from continuing, but note that the Cancel
option is not available while the product is actually being installed.
1. If you are installing from a SupportPac, complete the following steps,
otherwise proceed directly to step 2 on page 16;
a. On AIX, Linux, or Solaris, log in as root. On Windows, log on as an
administrator.
b. Create a temporary directory and extract the contents of the zipped file
supplied with Message Service Client for C/C++ into the directory.
A subdirectory of the temporary directory is created. The subdirectory is
called gxixms_install and contains the files needed for the installation.
Results
You have now successfully installed Message Service Client for C/C++, which is
ready to use.
What to do next
Before running any XMS applications, including the sample applications provided
with XMS, you must set up the messaging server environment as described in
Chapter 5, “Setting up the messaging server environment,” on page 25.
To use any of these options, type the appropriate command as described in the
sub-topics.
Running the installer from a command prompt using the option console allows
you to perform a console-based, text-based installation.
v On AIX, type the following command:
setup.bin -i console
v On Linux, type the following command:
setup.bin -i console
v On Solaris, type the following command:
setup.bin -i console
v On Windows, type the following command:
setup.exe -i console
Installing silently
If you invoke the installer from a command prompt using the runtime command
line option silent, you can perform an unattended, or silent installation.
Running the installer in silent mode requires no interaction with the wizard. You
can invoke a silent install using all the default setup options, or provide a response
file for a non-standard installation.
To use any of these options, type the appropriate command from the following list.
v To run a silent install using all the default setup options, type one of the
following commands:
– On AIX, type:
setup.bin -i silent -DLICENSE_ACCEPTED=TRUE
– On Linux, type:
setup.bin -i silent -DLICENSE_ACCEPTED=TRUE
– On Solaris, type:
setup.bin -i silent -DLICENSE_ACCEPTED=TRUE
– On Windows, type:
setup.exe -i silent -DLICENSE_ACCEPTED=TRUE
In this way, you explicitly accept the license agreement and the install can
proceed using the default options.
v To record a response file using the wizard, type one of the following commands:
– On AIX, type:
setup.bin -r responsefilename.txt
– On Linux, type:
setup.bin -r responsefilename.txt
– On Solaris, type:
setup.bin -r responsefilename.txt
– On Windows, type:
setup.exe -r responsefilename.txt
You can use the console option in conjunction with the above command to
record the response file in a text-based manner. For example
– On Windows, type:
setup.exe -i console -r responsefilename.txt
To remove Message Service Client for C/C++ from your AIX, Linux, Solaris, or
Windows system, follow this procedure. The Uninstaller also removes GSKit from
your system.
1. On AIX, Linux or Solaris, log in as root. On Windows, log on as an
administrator.
2. Run the uninstaller:
v On AIX, run the file called uninstaller that is in the directory
install_dir/_uninst.
v On Linux, run the file called uninstaller that is in the directory
install_dir/_uninst.
v On Solaris, run the file called uninstaller that is in the directory
install_dir/_uninst.
v On Windows, run the file uninstaller.exe that is in the directory
install_dir\_uninst.
install_dir is the directory where you have installed Message Service Client for
C/C++.
The Uninstaller window opens and displays the following message:
The wizard will uninstall Message Service Client for C/C++ from your computer.
3. Click Uninstall.
The Uninstaller window displays details of what is about to be uninstalled and
begins the uninstallation process. After all the items have been uninstalled, the
following message is displayed:
All items were successfully uninstalled.
4. Click Done to close the Uninstaller window.
Results
You have now successfully removed the Message Service Client for C/C++ from
your system.
The Add/Remove Programs window shows only one instance of Message Service
Client for C/C++. If you have problems uninstalling Message Service Client for
C/C++, or you have more than one instance of Message Service Client for C/C++,
you might want to uninstall Message Service Client for C/C++ using the
procedure described in “Uninstalling Message Service Client for C/C++” on page
21.
1. Log on to Windows as an administrator.
2. From the Windows task bar, click Start —> Settings —> Control Panel. The
Control Panel window opens.
22 Message Service Client for C/C++
3. Double-click Add/Remove Programs. The Add/Remove Programs window
opens.
4. Click IBM Message Service Client for C/C++ to select it.
5. Click Change/Remove. The Uninstaller window opens and displays the
following message:
The wizard will uninstall Message Service Client for C/C++ from your computer.
6. Click Uninstall. The Uninstaller window displays details of what is about to be
uninstalled and begins the uninstallation process. After all the items have been
uninstalled, the following message is displayed:
All items were successfully uninstalled.
7. Click Done to close the Uninstaller window.
Results
You have now successfully removed Message Service Client for C/C++ from your
system.
There are currently no prerequisites for applications that use a real-time connection
to a broker.
For additional information about prerequisites, refer to the readme.txt file for
Message Service Client for C/C++.
You must set up the messaging server environment before running any XMS
applications, including the sample applications provided with XMS.
You configure the queue manager and broker to run XMS applications in the same
way that you configure the queue manager and queued publish/subscribe
interface to run WebSphere MQ JMS applications. The following steps summarize
what you need to do:
1. On the queue manager, create the queues that your application needs.
For information about how to do this, see the WebSphere MQ System
Administration Guide.
If your application is a publish/subscribe application and uses Queued
Publish/Subscribe interface that needs access to WebSphere MQ JMS system
queues, wait until Step 4a before creating the queues.
2. Grant the user ID associated with your application the authority to connect to
the queue manager and the appropriate authorities to access the queues.
For information about how to do this, see the WebSphere MQ System
Administration Guide. If your application connects to the queue manager in
client mode, see also WebSphere MQ Clients or WebSphere MQ Security.
3. If your application connects to the queue manager in client mode, make sure
that a server connection channel is defined at the queue manager and that a
listener has been started.
For information about how to do this, see WebSphere MQ Clients.
You do not need to perform this step for each application that connects to the
queue manager. One server connection channel definition and one listener can
support all the applications that connect in client mode.
4. If your application is a publish/subscribe application, and uses Queued
Publish/Subscribe interface, perform the following steps.
a. On the queue manager, create the WebSphere MQ JMS system queues by
running the script of MQSC commands supplied with WebSphere MQ.
Make sure that the user ID associated with the broker has the authorities it
needs to access the queues.
For information about where to find the script and how to run it, see
WebSphere MQ Using Java.
You need to perform this step only once for the queue manager. The same
set of WebSphere MQ JMS system queues can support all XMS and
WebSphere MQ JMS applications that connect to the queue manager.
b. Grant the user ID associated with your application the authorities it needs
to access the WebSphere MQ JMS system queues.
For information about what authorities the user ID needs, see WebSphere
MQ Using Java.
c. For a broker of WebSphere Event Broker or WebSphere Message Broker,
create and deploy a message flow to service the queue where applications
send messages that they publish.
The basic message flow comprises an MQInput message processing node to
read the published messages and a Publication message processing node to
publish the messages.
For information about how to create and deploy a message flow, see the
WebSphere Event Broker or WebSphere Message Broker Information Center.
Results
You configure the broker to run XMS applications in the same way that you
configure the broker to run WebSphere MQ JMS applications. The following steps
summarize what you need to do but, for more details, see the WebSphere Event
Broker or WebSphere Message Broker Information Center:
1. Create and deploy a message flow to read messages from the TCP/IP port on
which the broker is listening and publish the messages.
You can do this in either of the following ways:
v Create a message flow that contains a Real-timeOptimizedFlow message
processing node.
v Create a message flow that contains a Real-timeInput message processing
node and a Publication message processing node.
You must configure the Real-timeOptimizedFlow or Real-timeInput node to
listen on the port used for real-time connections. In XMS, the default port
number for real-time connections is 1506.
You do not need to perform this step if a suitable message flow is already
deployed at the broker.
2. If you require messages to be delivered to your application using WebSphere
MQ Multicast Transport, configure the broker to enable multicast. Configure the
topics that need to be multicast enabled, specifying a reliable quality of service
for those topics that need to be configured for reliable multicast.
3. If your application supplies a user ID and a password when it connects to the
broker, and you want the broker to authenticate your application using this
information, configure the user name server and the broker for simple
telnet-like password authentication.
Results
Any queue or topic spaces that you require must be defined. By default a topic
space called Default.Topic.Space will already have been predefined during the
server installation but, if you require further topic spaces, you must create these
yourself. You do not need to predefine individual topics within a topic space, since
the server instantiates these dynamically as required.
The following steps summarize what you need to do but, for more details, see the
WebSphere Application Server Information Center.
1. Create the queues that your application needs for point-to-point messaging.
2. Create any additional topic spaces that your application needs for
publish/subscribe messaging.
Results
These samples do not cover the whole of the API, but rather provide an overview
of how to use some of the most common features. They are subject to change in
future releases of XMS.
If you require guidance on how to create your own applications, use the sample
applications as a starting point. Look through the sample source code and identify
the key steps to create each required object for your application
(ConnectionFactory, Connection, Session, Destination, and a Producer, or a
Consumer, or both), and to set any specific properties that are needed to specify
how you want your application to work. For additional information, see Chapter 7,
“Writing XMS applications,” on page 35.
Table 4 shows the three sets of sample applications (one for each API) that are
supplied with XMS.
Table 4. XMS sample applications
Name of sample Description
SampleConsumerC A message consumer application that consumes messages from
a queue or topic.
SampleConsumerCPP
SampleProducerC A message producer application that produces messages to a
queue or on a topic.
SampleProducerCPP
SampleConfigC A configuration application that you can use to create a
file-based administered object repository containing a connection
factory and destination for your particular connection settings.
This administered object repository can then be used with each
of the sample consumer and producer applications.
The samples that support the same functionality in the various APIs have
syntactical differences.
v The sample message consumer and producer applications both support the
following:
Both the source and a compiled version are provided for each application.
Operating modes
All the samples are compatible and can therefore operate across languages.
To find out where sample applications for Message Service Client for C/C++ are
installed:
v For AIX, Linux, and Solaris see Table 2 on page 20.
v For Windows, see Table 3 on page 21.
Before running any of the supplied sample applications, you must first set up the
messaging server environment so that the applications can connect to a server as
described in Chapter 5, “Setting up the messaging server environment,” on page
25.
For C or C++ sample applications, you must have set up one of the following
environment variables:
v On AIX, the <install_dir>/lib directory on your LIBPATH
v On Linux and Solaris, the <install_dir>/lib directory on your
LD_LIBRARY_PATH
v On Windows, the <install_dir>\bin directory on your PATH
The operation of the C and C++ sample applications is identical for all platforms.
The following steps summarize what you need to do to run the C and C++ sample
applications.
1. Select the mode in which you want to run the sample application. Type either
Advanced or Simple.
2. Answer the questions. To select the default value, which is shown in the square
brackets at the end of the question, press Enter. To select a different value, type
the appropriate value, and press Enter.
Here is an example question:
Enter connection type [wpm]:
In this case, the default value is wpm (connection to a WebSphere service
integration bus).
Results
When you run the sample applications, response files are generated automatically
in the current working directory. Response file names are in the format
<connectiontype>-<sampletype>.rsp; (for example, wpm-producer.rsp). If required,
you can use a generated response file to rerun the sample application with the
same options, without re-entering these options manually.
To build the C or C++ samples, you must have the appropriate compiler installed
as described in “Operating environments” on page 13.
This section provides the information that you need to build the C and C++
applications.
1. Open a command prompt window.
2. Change to the directory that contains the source and makefile for the sample
application you want to build.
3. Type one of the following commands:
a. If you are using AIX, Linux, or Solaris type make.
b. If you are using Windows, type nmake.
The command builds an executable version of the application in the current
directory. This application has the same name as the folder; for example, if you
are building the C version of the sample message producer application,
SampleProducerC.exe is created in the SampleProducerC folder.
4. Before running the samples, make sure that the directory where you have
installed XMS is specified by the appropriate environment variable:
a. On AIX, the <install_dir>/lib directory must be in the path specified by the
LIBPATH environment variable.
b. On Linux and Solaris, the <install_dir>/lib directory must be in the path
specified by the LD_LIBRARY_PATH environment variable.
If you are writing applications in C, see also Chapter 8, “Writing XMS applications
in C,” on page 63. If you are writing applications in C++, see also Chapter 9,
“Writing XMS applications in C++,” on page 71.
Exceptions to these rules are indicated by entries labelled “Thread context” in the
interface definitions of the methods in the API reference chapters.
For C and C++ applications a single type of ConnectionFactory has a property that
enables you to select which type of protocol you want to use for a connection.
XMS does not acknowledge the receipt of any messages that it has failed to
acknowledge during a session, prior to closing the connection. For more
information about acknowledging the receipt of messages, see “Message
acknowledgement” on page 39.
Exception Handling
If a C application registers an exception listener function and context data with a
connection, or if a C++ application registers an exception listener with a
connection, XMS notifies the application asynchronously when a serious problem
occurs with the connection.
The HTTP protocol can be used in situations where a direct TCP/IP connection is
not possible. One common situation is when communicating through a firewall,
such as when two enterprises exchange messages. Using HTTP to communicate
through a firewall is often referred to as HTTP tunnelling. HTTP tunnelling,
however, is inherently slower than using a direct TCP/IP connection because
HTTP headers add significantly to the amount of data that is transferred, and
because the HTTP protocol requires more communication flows than TCP/IP.
Sessions
A session is a single threaded context for sending and receiving messages.
An application can create multiple sessions, where each session produces and
consumes messages independently of the other sessions. If two message consumers
in separate sessions (or even in the same session) subscribe to the same topic, each
receives a copy of any message published on that topic.
If an application must process messages concurrently on more than one thread, the
application must first create the additional threads, and then use a different session
on each thread.
Transacted sessions
XMS applications can run local transactions. A local transaction is a transaction that
involves changes only to the resources of the queue manager or service integration
bus to which the application is connected.
To roll back a transaction, an application calls the Rollback method of the Session
object. When a transaction is rolled back, all messages sent within the transaction
are discarded by the messaging server, and all messages received within the
transaction become available for delivery again. In the point-to-point domain, the
messages that were received are put back on their queues and become visible to
other applications again.
Message acknowledgement
Every session that is not transacted has an acknowledgement mode that
determines how messages received by the application are acknowledged. Three
acknowledgement modes are available, and the choice of acknowledgement mode
affects the design of the application.
XMS uses the same mechanism for acknowledging the receipt of messages that
JMS uses.
If a session is not transacted, the way that messages received by the application are
acknowledged is determined by the acknowledgement mode of the session. The
three acknowledgement modes are described in the following paragraphs:
XMSC_AUTO_ACKNOWLEDGE
The session automatically acknowledges each message received by the
application.
If messages are delivered synchronously to the application, the session
acknowledges receipt of a message every time a Receive call completes
successfully. If messages are delivered asynchronously to a C application,
the session acknowledges receipt of a message every time a call to a
message listener function completes successfully. For a C++ application, the
session acknowledges receipt of a message every time a call to the
onMessage() method of a message listener completes successfully.
XMS uses one thread to handle all asynchronous message delivery for a session.
This means that only one message listener function or one onMessage() method
can run at a time. If more than one message consumer in a session is receiving
messages asynchronously, and a message listener function or onMessage() method
is currently delivering a message to one message consumer, then any other
message consumers that are waiting for the same message must continue to wait.
Other messages that are waiting to be delivered to the session must also continue
to wait.
Using the Receive methods, an application can wait a specified period of time for a
message, or it can wait indefinitely. Alternatively, if an application does not want
to wait for a message, it can use the Receive with No Wait method.
An XMS application can either create a Destination object at run time, or obtain a
predefined destination from the repository of administered objects.
You can create a destination for a C or C++ application in either of the following
ways:
v By specifying a uniform resource identifier (URI), which is a string that identifies a
destination, you have the option to specify one or more properties of the
destination
v By specifying whether you require a queue or topic and providing a destination
name
For further information about creating a URI, see “Topic uniform resource
identifiers” and “Queue uniform resource identifiers” on page 44.
The URI for a topic begins with the sequence topic://, followed by the name of
the topic and (optional) a list of name-value pairs that set the remaining topic
properties. A topic name cannot be empty.
For more information about the properties of a topic, including the name and valid
values that you can use in a URI, see “Properties of Destination” on page 409.
When specifying a topic URI for use in a subscription, wildcards can be used. The
syntax for these wildcards depends on the connection type and broker version; the
following options are available:
v WebSphere MQ V7.0 queue manager with Character level wildcard format
v WebSphere MQ V7.0 queue manager with Topic level wild card format
v WebSphere MQ V6.0 queue manager with broker V1 (WebSphere MQ V6.0
Publish/Subscribe)
v WebSphere MQ V6.0 with, or real-time connection to, broker V2 (WebSphere
Event Broker or WebSphere Message Broker)
v WebSphere service integration bus
WebSphere MQ V7.0 queue manager with Character level wildcard format uses the
following wild card characters:
* for 0 or more characters
? for 1 character
% for an escape character
WebSphere MQ V7.0 queue manager with Topic level wild card format uses the
following wildcard characters:
# to match multiple levels
+ to match a single level
Table 6 gives some examples of how to use this wildcard scheme.
Table 6. Example URIs using topic level wildcard scheme for WebSphere MQ V7.0 queue manager
Uniform Resource
Identifier Matches Examples
″topic://Sport/+/Results″ All topics with a single hierarchical level ″topic://Sport/Football/Results″ and
name between Sport and Results ″topic://Sport/Ju-Jitsu/Results″
″topic://Sport/#/Results″ All topics starting with ″Sport/″ and ″topic://Sport/Football/Results″ and
ending in ″/Results″ ″topic://Sport/Hockey/National/Div3/
Results″
″topic://Sport/Football/#″ All topics starting with ″Sport/Football/″ ″topic://Sport/Football/Results″ and
″topic://Sport/Football/TeamNews/
Signings/Managerial″
WebSphere MQ V6.0 queue manager with broker V1 uses the following wildcard
characters:
* for 0 or more characters
? for 1 character
% for an escape character
Table 6 on page 43 gives some examples of how to use this wildcard scheme.
The URI for a queue begins with the sequence queue://, followed by the name of
the queue; it might also include a list of name-value pairs that set the remaining
queue properties.
For WebSphere MQ queues (but not for WebSphere Application Server default
messaging provider queues), the queue manager on which the queue resides may
be specified before the queue, with a / separating the queue manager name from
the queue name.
If a queue manager is specified, then it must be the one to which XMS is directly
connected for the connection using this queue, or it must be accessible from this
queue. Remote queue managers are only supported for retrieving messages from
If no queue manager is specified, then the extra / separator is optional, and its
presence or absence makes no difference to the definition of the queue.
The following queue definitions are all equivalent for a WebSphere MQ queue
called QB on a queue manager called QM_A, to which XMS is directly connected:
queue://QB
queue:///QB
queue://QM_A/QB
The name of the queue manager is omitted. This is interpreted as the queue
manager to which the owning connection is connected at the time when the Queue
object is used.
Temporary destinations
XMS applications can create and use temporary destinations.
Message producers
In XMS, a message producer can be created either with a valid destination or with
no associated destination. When creating a message producer with a null
destination, a valid destination needs to be specified when sending a message.
To create a message producer with no associated destination when using the C++
API, a default xms::Destination object created using the default constructor must be
passed into the Session::createProducer() method. For further details about creating
a message producer in a C++ API, see “Session” on page 373.
Message consumers
Message consumers can be classified as durable and non-durable subscribers and
synchronous and asynchronous message consumers.
Durable subscribers
A durable subscriber is a message consumer that receives all messages published
on a topic, including those published while the subscriber is inactive.
To create a durable subscriber for a topic, an application calls the Create Durable
Subscriber method of a Session object, specifying as parameters a name that
identifies the durable subscription and a Destination object representing the topic.
The application can create a durable subscriber with or without a message selector,
and it can specify whether the durable subscriber is to receive messages published
by its own connection.
The name that identifies the durable subscription must be unique within the client
identifier, and therefore the client identifier forms part of the full, unique identifier
of the durable subscription. The messaging server maintains a record of the
durable subscription and ensures that all messages published on the topic are
retained until they are acknowledged by the durable subscriber or they expire.
The messaging server continues to maintain the record of the durable subscription
even after the durable subscriber closes. To reuse a durable subscription that was
created previously, an application must create a durable subscriber specifying the
same subscription name, and using a session with the same client identifier, as
those associated with the durable subscription. Only one session at a time can have
a durable subscriber for a particular durable subscription.
Note that you cannot change the subscriber queue for a durable subscription. The
only way to change the subscriber queue is to delete the subscription and create a
new one.
Non-durable subscribers
A non-durable subscriber is a message consumer that only receives messages that
are published while the subscriber is active. Messages delivered while the
subscriber is inactive are lost.
The information in this section is relevant only when you are using
publish/subscribe messaging over WebSphere MQ v6.0 queue manager.
If consumer objects are not deleted before or during the closing of the connection,
messages can be left on the broker queues for subscribers that are no longer active.
In this situation, the queues can be cleared of these messages using the Cleanup
utility provided with WebSphere MQ Classes for JMS. Details of how to use this
utility are provided in WebSphere MQ Using Java. You may also need to increase the
queue depth of the subscriber queue if there are large numbers of messages left on
this queue.
If the Receive with No Wait method is used, the synchronous message consumer
receives messages without any delay; if the next message is available, it is received
immediately, otherwise a pointer to a null Message object is returned.
Poison messages
A poison message is one which cannot be processed by a receiving MDB
application. If a poison message is encountered, the XMS MessageConsumer object
can requeue it according to two queue properties, BOQUEUE, and BOTHRESH.
The WebSphere MQ queue manager keeps a record of the number of times that
each message has been backed out. When this number reaches a configurable
threshold value, the message consumer requeues the message to a named backout
queue. If this re-queuing fails for any reason, the message is removed from the
input queue and either requeued to the dead-letter queue, or discarded.
XMS ConnectionConsumer objects handle poison messages in the same way and
using the same queue properties. If multiple connection consumers are monitoring
the same queue, it is possible that the poison message may be delivered to an
application more times than the threshold value before the requeue occurs. This
behavior is due to the way individual connection consumers monitor queues and
requeue poison messages.
The threshold value and the name of the back out queue are attributes of a
WebSphere MQ queue. The names of the attributes are BackoutThreshold and
BackoutRequeueQName. The queue they apply to is as follows:
v For point-to-point messaging, this is the underlying local queue. This is
important when message consumers and connection consumers use queue
aliases.
v For publish/subscribe messaging in WebSphere MQ messaging provider normal
mode, it is the model queue from which the Topic’s managed queue is created.
v For publish/subscribe messaging in WebSphere MQ messaging provider
migration mode, it is the CCSUB queue defined on the TopicConnectionFactory
object, or the CCDSUB queue defined on the Topic object.
For publish/subscribe messaging, if your system creates a dynamic queue for each
subscription, these attribute values are obtained from the WebSphere MQ classes
for JMS model queue, SYSTEM.JMS.MODEL.QUEUE. To alter these settings, use:
ALTER QMODEL(SYSTEM.JMS.MODEL.QUEUE) BOTHRESH(threshold value)
BOQUEUE(your.backout.queue.name)
If the backout threshold value is zero, poison message handling is disabled, and
poison messages remain on the input queue. Otherwise, when the backout count
reaches the threshold value, the message is sent to the named backout queue. If the
backout count reaches the threshold value, but the message cannot go to the
backout queue, the message is sent to the dead-letter queue or it is discarded. This
situation occurs if the backout queue is not defined, or if the MessageConsumer
object cannot send the message to the backout queue.
Queue browsers
An application uses a queue browser to browse messages on a queue without
removing them.
To create a queue browser, an application calls the Create Queue Browser method
of a Session object, specifying as a parameter a Destination object that identifies the
queue to be browsed. The application can create a queue browser with or without
a message selector.
After creating a queue browser, the application can call the Get Messages method
of the QueueBrowser object to get a list of the messages on the queue. The list of
messages is returned as an iterator that encapsulates a list of Message objects. The
order of the Message objects in the list is the same as the order in which the
messages would be retrieved from the queue. The application can then use the
iterator to browse each message in turn.
The iterator is updated dynamically as messages are put on the queue and
removed from the queue. Each time the application uses the iterator to browse the
next message on the queue, the message returned reflects the current contents of
the queue. When the iterator indicates that there are no more messages on the
queue, it stops returning messages, even if further messages arrive on the queue.
However, by calling the Reset Iterator method of the Iterator object, the application
can continue to use the same iterator to browse messages, starting from the
beginning of the queue.
An application can call the Get Messages method more than once for a given
queue browser. Each call returns a new iterator. The application can therefore use
more than one iterator to browse the messages on a queue and maintain multiple
positions within the queue.
An application can use a queue browser to search for a suitable message to remove
from a queue, and then use a message consumer with a message selector to
remove the message. The message selector can select the message according to the
Requestors
An application uses a requestor to send a request message and then to wait for
and to receive the reply.
Many messaging applications are based on algorithms that send a request message
and then wait for a reply. XMS provides a class called Requestor to help with the
development of this style of application.
After creating a requestor, the application can call the Request method of the
Requestor object to send a request message and then wait for, and receive, a reply
from the application that receives the request message. The call waits until the
reply is received or until the session ends, whichever occurs first. Only one reply is
required by the requestor for each request message.
When the application closes the requestor, the temporary queue or topic is deleted.
The associated session, however, does not close.
Object Deletion
When an application deletes an XMS object that it has created, XMS releases the
internal resources that have been allocated to the object.
When an application creates an XMS object, XMS allocates memory and other
internal resources to the object. XMS retains these internal resources until the
application explicitly deletes the object by calling the object’s close or delete
method, at which point XMS releases the internal resources. In a C++ application,
an object is also deleted when it goes out of scope. If an application tries to delete
an object that is already deleted, the call is ignored.
Table 9 lists the Java equivalent data type, size, and minimum and maximum value
of each XMS primitive type.
Table 9. XMS data types and their Java equivalents
Compatible
Java data
XMS data type type Size Minimum value Maximum value
xmsBOOL boolean 32 bits xmsFALSE xmsTRUE
7
xmsSBYTE byte 8 bits -2 (-128 ) 27-1 (127)
xmsCHAR byte 8 bits -27 (-128 ) 27-1 (127)
xmsCHAR16 char 16 bits 0 (\u0000) 216-1 (\uFFFF)
xmsSHORT short 16 bits -215 (-32768) 215-1 (32767)
xmsINT int 32 bits -231 (-2147483648) 231-1 (2147483647)
xmsLONG long 64 bits -263 (-9223372036854775808) 263-1 (9223372036854775807)
xmsFLOAT float 32 bits -3.402823E-38 (to 7 digits 3.402823E+38 (to 7 digits
precision) precision)
xmsDOUBLE double 64 bits -1.79769313486231E-308 (to 15 1.79769313486231E+308 (to 15
digits precision) digits precision)
A property of an object has a name and a value; the value has an associated data
type, where the value of a property is also referred to as the property type.
An application uses the methods of the PropertyContext class to get and set the
properties of objects. In order to get the value of a property, an application calls
the method that is appropriate for the property type. For example, to get the value
of an integer property, an application typically calls the Get Integer Property
method.
However, when an application gets the value of a property, the value can be
converted by XMS into another data type. For example, to get the value of an
integer property, an application can call the Get String Property method, which
returns the value of the property as a string. The conversions supported by XMS
are shown in Table 10.
Table 10. Supported conversions from a property type to other data types
Property type Supported target data types
String xmsBOOL, xmsDOUBLE, xmsFLOAT, xmsINT, xmsLONG,
xmsSBYTE, xmsSHORT
xmsBOOL String, xmsSBYTE, xmsINT, xmsLONG, xmsSHORT
The following rules apply when a property value is converted from one data type
to another:
v When converting a boolean property value to a string, the value xmsTRUE is
converted to the string “true”, and the value false is converted to the string
“false”.
v When converting a boolean property value to a numeric data type, including
xmsSBYTE, the value xmsTRUE is converted to 1, and the value xmsFALSE is
converted to 0.
v When converting a string property value to a boolean value, the string “true”
(not case sensitive) or “1” is converted to xmsTRUE, and the string “false” (not
case sensitive) or “0” is converted to xmsFALSE. All other strings cannot be
converted.
v When converting a string property value to a value with data type xmsINT,
xmsLONG, xmsSBYTE, or xmsSHORT, the string must have the following
format:
[blanks][sign]digits
The string components are defined as follows:
blanks Optional leading blank characters.
sign An optional plus sign (+) or minus sign (-) character.
digits A contiguous sequence of digit characters (0-9). At least one digit
character must be present.
Conversions from a property type to other data types are supported by the
methods of both the Property and the PropertyContext classes. However, the C
functions xmsPropertyGetStringByRef() and xmsGetStringPropertyByRef() make no
attempt to convert a property value that is not a string. If an application calls
either of these functions to get a pointer to a property value that is not a string,
XMS may return an error.
Iterators
An iterator encapsulates a list of objects and a cursor that maintains the current
position in the list. A C or C++ application uses an iterator to retrieve each object
in the list in turn.
The following code fragment shows how a C application can use an iterator to
print out all properties of a message:
/********************************************************/
/* XMS Sample using an iterator to browse properties */
/********************************************************/
rc = xmsMsgGetProperties(hMsg, &it, xmsError);
if (rc == XMS_OK)
{
rc = xmsIteratorHasNext(it, &more, xmsError);
while (more)
{
rc = xmsIteratorGetNext(it, (xmsHObj)&p, xmsError);
if (rc == XMS_OK)
{
xmsPropertyGetName(p, name, 100, &len, xmsError);
printf("Property name=\"%s\"\n", name);
xmsPropertyGetTypeId(p, &type, xmsError);
switch (type)
{
case XMS_PROPERTY_TYPE_INT:
{
xmsINT value=0;
xmsPropertyGetInt(p, &value, xmsError);
printf("Property value=%d\n", value);
break;
}
case XMS_PROPERTY_TYPE_STRING:
{
xmsINT len=0;
char value[100];
xmsPropertyGetString(p, value, 100, &len, xmsError);
printf("Property value=\"%s\"\n", value);
break;
}
default:
{
printf("Unhandled property type (%d)\n", (int)type);
}
}
xmsPropertyDispose(&p, xmsError);
}
rc = xmsIteratorHasNext(it, &more, xmsError);
}
printf("Finished iterator....\n");
When an application starts, XMS derives an appropriate CCSID for the application
from the environment in which the application is running. This CCSID is called the
process CCSID. At any time, the application can change the process CCSID by
calling xmsSetClientCCSID(). This is a C function that does not belong to any class,
but C++ applications can use the function as well.
In the same way, when an application uses a connection to create a session, XMS
copies the XMSC_CLIENT_CCSID property of the Connection object to the newly
created Session object. When an application uses a session to create a message
producer or message consumer, XMS copies the XMSC_CLIENT_CCSID property
of the Session object to the newly created MessageProducer or MessageConsumer
object. In each case, XMS copies the property only at the time the application
creates the object.
The strings of character data that an application passes to, and receives from, XMS
include (but are not exclusively confined to) the strings in messages. The strings
that require conversion might be in any of the following parts of a message:
v Header fields (see “Header fields in an XMS message” on page 97)
v Properties (see “Properties of an XMS message” on page 98)
v The body (see “The body of an XMS message” on page 101)
When XMS converts the strings in an outgoing message, it uses the code page
associated with the session that created the message. When XMS converts the
strings in an incoming message, it uses the code page associated with the message
consumer that receives the message. XMS determines the code page from the value
of the XMSC_CLIENT_CCSID property of the relevant Session or
MessageConsumer object.
This section lists the prerequisites you need to build your own C or C++
applications. For additional guidance on how to build your own applications, use
the makefiles provided for each sample application.
Tip: To assist with problem diagnosis in the event of a failure, you might find it
helpful to compile applications with symbols included.
On Windows, if you are building a C or C++ application, make sure that your
compilation settings are correct. All of the XMS libraries are compiled using the
multithreaded runtime libraries. Therefore, when you are a building C or C++
application using the XMS libraries, make sure that your project or makefile
compiler flag settings are set to select multi-threaded runtime libraries (/MD or,
for debug, /MDd), and not single-threaded runtime libraries (/ML or, for debug,
/MLd).
The following table lists the outcome for the possible combinations of network
stacks in use for the host name and local address.
Table 11. Network stack selection mechanism
Stack Host Name Local Address Connection result
IPv4 only stack IPv4 address None Connection binds to
IPv4 stack
IPv6 address None Connection fails to
resolve host name
Host name resolves None Connection binds to
to both IPv4 and IPv6 IPv4 stack
addresses
IPv4 address IPv4 address Connection binds to
IPv4 stack
IPv6 address IPv4 address Connection fails to
resolve host name
Remote host name IPv4 address Connection binds to
resolves to both IPv4 IPv4 stack
and IPv6 addresses
Any address IPv6 address Connection fails to
resolve local address
IPv4 address Local address Connection binds to
resolves to both IPv4 IPv4 stack
and IPv6 addresses
IPv6 address Local address Connection fails to
resolves to both IPv4 resolve host name
and IPv6 addresses
Remote host name Local address Connection binds to
resolves to both IPv4 resolves to both IPv4 IPv4 stack
and IPv6 addresses and IPv6 addresses
Object handles in C
A C application uses an object handle to access an object. There are two kinds of
object handles; one has a data type that is related to the type of the object, and the
other is a generic object handle whose data type is not related to the type of the
object.
When a C application calls a function to create an object, XMS stores the object
internally and returns a handle for the object to the application. The application
can then use the handle to access the object.
Every object handle has a data type, which is related to the object type. Table 12
shows the object handle data type for each type of object. Note that BytesMessage,
MapMessage, ObjectMessage, StreamMessage, TextMessage, and Message objects
all have handles with the same data type, xmsHMsg. For more information about
how to use handles for messages, see “The body of an XMS message” on page 101.
Table 12. Data types for object handles
Type of object Object handle data type
Connection xmsHConn
ConnectionFactory xmsHConnFact
ConnectionMetaData xmsHConnMetaData
Destination xmsHDest
ErrorBlock xmsHErrorBlock
InitialContext xmsHInitialContext
Iterator xmsHIterator
Message, BytesMessage, MapMessage, ObjectMessage, xmsHMsg
StreamMessage, and TextMessage
MessageConsumer xmsHMsgConsumer
MessageProducer xmsHMsgProducer
Property xmsHProperty
Certain functions return a generic object handle, which is not related to the type of
object that they create. A generic object handle has data type xmsHObj.
If an application receives a generic object handle from one of these functions, the
application can call the xmsGetHandleTypeId() function in the PropertyContext
class to determine the related data type object handle for that object. The
application can then call any function to perform an operation on the object by
casting, if necessary, the generic object handle to the data type required by the
function.
Object Properties in C
A C application uses the functions in the PropertyContext class to get and set the
properties of objects.
For each XMS data type, the PropertyContext class contains a function to get the
value of a property with that data type and a function to set its value. For
example, a C application can call the function xmsGetIntProperty() to get the value
of an integer property and the function xmsSetIntProperty() to set its value.
Functions in the PropertyContext class can operate on any object that can have
properties. Each individual class does not contain its own functions to get and set
the properties of objects of that class. As a result, functions in the PropertyContext
class accept only generic object handles as input. If an application is currently
accessing an object using a handle with a data type that is related to the type of
the object, the application must cast the handle to the generic object handle data
type, xmsHObj, in order to get or set the properties of the object. For more
information about generic object handles, see “Object handles in C” on page 63.
All objects except ErrorBlock, Iterator, and Property objects can have properties.
If an application sets the value of a property, the new value replaces any previous
value the property had.
If the buffer is not large enough to store the whole string, including the
terminating null character, XMS returns the string truncated to the length of the
buffer, sets the actualLength parameter to the length of the whole string, and
returns error code XMS_E_DATA_TRUNCATED.
In the C API, certain functions return a byte array as a parameter. Each of these
functions uses the same interface for retrieving a byte array. The following example
written in C code illustrates the function, xmsGetByteArrayProperty() in the
PropertyContext class:
xmsRC xmsGetByteArrayProperty(xmsHObj object
xmsCHAR *propertyName,
xmsSBYTE *propertyValue,
xmsINT length,
xmsINT *actualLength
xmsHErrorBlock errorBlock) const;
If the buffer is not large enough to store the whole array, XMS returns the array
truncated to the length of the buffer, sets the actualLength parameter to the length
of the whole array, and returns an error.
The C API has functions to deliver better performance. When an application calls
one of these functions, one parameter returns a pointer to a string or byte array
that is stored in memory owned by XMS, and another parameter returns the length
of the string or byte array. Examples of these functions are
xmsBytesMsgReadBytesByRef() and xmsGetStringPropertyByRef().
If data conversion is required for a string, XMS converts the characters into the
code page of the application and returns a pointer to the converted string. The
length returned to the application is the length of the converted string.
Note: These functions return a pointer to memory owned by XMS. You must not
attempt to free or modify the contents of this memory as doing so will cause
unpredictable results.
The pointer returned to the application remains valid until the next time that the
application adds a new piece of data to the bytes message.
In the C API, certain functions accept a string as an input parameter. Each of these
functions uses the same interface for passing a string to XMS. The following
example of C code illustrates the function, xmsSetStringProperty() in the
PropertyContext class:
xmsRC xmsSetStringProperty(xmsHObj object,
xmsCHAR *propertyName,
xmsCHAR *propertyValue,
xmsINT length,
xmsHErrorBlock errorBlock);
Error handling in C
Most functions in the C API return a value that is a return code, and have an
optional input parameter that is a handle for an error block. This section describes
the roles of the return code and the error block.
Return codes
The return code from a C function call indicates whether the call was successful.
The return code has data type xmsRC. Table 13 lists the possible return codes and
gives their meaning.
Table 13. Return codes from C function calls
Return code Meaning
XMS_OK The call completed successfully.
Any other value The call failed. The error block contains more details about why the call
failed. The return code is the same as the exception code that is
returned in the error block.
XMS provides a set of helper functions to create an error block and extract
information from it. An application must use a helper function to create an error
block and obtain a handle for it before calling the first function that can accept the
handle as an input parameter. If the function call fails, the application can then use
other helper functions to extract information about the error that XMS has stored
in the error block. For details of these helper functions, see “ErrorBlock” on page
157.
The format and content of the context data is defined by the application, and the
data itself occupies memory owned by the application. For example, the context
data might be a structure allocated on the heap. The context data contains all the
information that the message listener function needs to refer to when processing a
message. XMS does not make a copy of the context data, and so the application
must ensure that the context data is still available when XMS calls the message
listener function.
A new message listener function and context data can be registered with a message
consumer without cancelling the registration of an existing message listener
function. If an existing message listener function is running when a new message
listener function is registered, the active message listener function completes as
usual, and any subsequent messages are processed by calls to the new message
listener function. If a transaction is in progress when a message listener function is
changed, the transaction is completed by calls to the new message listener
function.
For more information about the message listener function, including its signature,
see “MessageListener” on page 198.
The context data contains all the information that the exception listener function
requires when processing an error block. In all other respects, the context data is
used with an exception listener function in the same way as it is used with a
message listener function.
For more information about the exception listener function, including its signature,
see “MessageListener” on page 333.
Note: The application is required to release the resources used by an error block
received in this way. XMS does not release these resources.
Namespaces in C++
All the C++ classes supplied with XMS are declared in a namespace called xms.
A C++ application can therefore adopt one of the following approaches when
referring to the names of XMS classes:
v The application can qualify the names of XMS classes with the name of the
namespace, xms, as show in the following C++ code fragment:
#include <xms.hpp>
connFact.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
connFact.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
connFact.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
connFact.setIntProperty(XMSC_RTT_PORT, 1506);
conn = connFact.createConnection();
return(0);
}
v The application can use a using directive to make the names of XMS classes
available without having to qualify them. For example:
#include <xms.hpp>
connFact.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
connFact.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
connFact.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
connFact.setIntProperty(XMSC_RTT_PORT, 1506);
conn = connFact.createConnection();
return(0);
}
return(0);
}
To make it easier to create and manipulate String objects, certain operators and
constructors are overloaded on the String class. If an application calls a method
that requires a String object as an input parameter, it is not necessary to create the
String object first. The application can pass a null terminated character array to the
method as a parameter, and XMS automatically creates a String object on the stack.
In addition, the String class encapsulates methods to create and manipulate String
objects. For the definitions of these methods, see “String” on page 395.
The parameters propertyValue, length, and actualLength control the retrieval of the
byte array in the same way as described in “C functions that return a byte array
by value” on page 65.
Properties in C++
A C++ application uses the methods in the PropertyContext class to get and set the
properties of objects.
If an application sets the value of a property, the new value replaces any previous
value the property had.
When a shallow copy of an object is made, the object is deleted only when all the
variables that reference the object go out of scope. If the application closes or
deletes the object before the variables that reference the object go out of scope, the
application can no longer access the object through any of the variables.
cf.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
cf.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
cf.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
cf.setIntProperty(XMSC_RTT_PORT, 1506);
conn = cf.createConnection();
sess = conn.createSession();
sess2 = sess;
sess2.setStringProperty("property", "test");
if (sess2.isNull() != xmsTRUE)
{
xms::Session sess3 = sess2;
// The sess3 variable is now out of scope, but the second property
// is still set in the Session object.
sess.close();
return(0);
}
The Exception class is a superclass of each of the remaining classes in this list. As a
result, an application can include the calls to XMS methods in a try block and, to
catch all types of XMS exception, the application can specify the Exception class in
the exception declaration of the catch construct. The following code fragment
illustrates this technique:
#include <xms.hpp>
try
{
xms::ConnectionFactory connFact;
xms::Connection conn;
connFact.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
connFact.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
connFact.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
connFact.setIntProperty(XMSC_RTT_PORT, 1506);
conn = connFact.createConnection();
return(nRC);
}
try
{
xms::ConnectionFactory connFact;
connFact.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
connFact.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
connFact.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
connFact.setIntProperty(XMSC_RTT_PORT, 1506);
nRC = -1;
}
return(nRC);
}
After an application catches an XMS exception, it can use the methods of the
Exception class to find out information about the error. For the definitions of these
methods, see “Exception” on page 297. The information encapsulated by an XMS
exception is essentially the same as the information provided to a C application in
an error block. For details of this information, see “The error block” on page 67.
XMS can create an exception for each error it detects during a call and link the
exceptions to form a chain. After an application has caught the first exception, it
can call the getLinkedException() method to get a pointer to the next exception in
the chain. The application can continue to call the getLinkedException() method on
each exception in the chain until a null pointer is returned, indicating that there are
no more exceptions in the chain.
If more than one message consumer in a session has a registered message listener,
only one onMessage() method can run at a time. For more information about this
situation, and what to do if your application requires concurrent delivery of
messages, see “Asynchronous message delivery” on page 40.
-------–--------------------------------------------
if (pMsg->getType() == XMS_MESSAGE_TYPE_BYTES)
{
xms::BytesMessage * pBytes = (xms::BytesMessage *) pMsg;
delete pMsg;
}
}
The following code fragment now shows how an application can use this message
listener class to implement the asynchronous delivery of messages to a message
consumer:
#include <xms.hpp>
try
{
cf.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
cf.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
cf.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
cf.setIntProperty(XMSC_RTT_PORT, 1506);
conn = cf.createConnection();
sess = conn.createSession();
dest = xms::Destination(XMS_DESTINATION_TYPE_TOPIC, "test");
msgConn = sess.createConsumer(dest);
msgConn.setMessageListener(&msgLst);
conn.start();
while(xmsTRUE)
{
Sleep(1000);
cout << "Waiting..." << endl;
}
}
catch(exception & ex)
{
nRC = -1;
return(nRC);
}
A C++ application must define an exception listener class that is based on the
abstract class ExceptionListener. The exception listener class must provide an
implementation of the onException() method. The application can then instantiate
the class to create an exception listener, and register the exception listener with a
connection by calling the setExceptionListener() method. Subsequently, if XMS
detects a problem with the connection, XMS calls the onException() method to pass
an exception to the application. XMS does not make a copy of the exception
listener, and so the application must ensure that the exception listener is still
available when XMS calls the onException() method.
cf.setIntProperty(XMSC_CONNECTION_TYPE, XMSC_CT_RTT);
cf.setIntProperty(XMSC_RTT_CONNECTION_PROTOCOL, XMSC_RTT_CP_TCP);
cf.setStringProperty(XMSC_RTT_HOST_NAME, "localhost");
cf.setIntProperty(XMSC_RTT_PORT, 1506);
conn = cf.createConnection();
hConn = conn.getHandle();
xmsConnStart(hConn, NULL);
return(0);
}
Using the handle for an object, a C++ application can close or delete the object by
calling the appropriate C API function. However, if a C++ application does that it
can no longer use the object using the C++ API.
Being able to use the C API is useful because some functions are available only in
the C API. An example of such a function is described in “C functions that return a
string or byte array by reference” on page 66.
File System object directories take the form of serialized Java and Naming
Directory Interface (JNDI) objects. LDAP object directories are directories that
contain JNDI objects. File System and LDAP object directories can both be
administered using the JMSAdmin tool available with WebSphere MQ. Both these
object directories can be used to administer client connections by centralizing
WebSphere MQ connection factories and destinations. This allows the network
administrator to deploy multiple applications that all refer to the same central
repository, and that are automatically updated to reflect changes to connection
settings made in the central repository.
The following table demonstrates the mappings between some of the most
common properties of connection factories and destinations. The properties shown
in this table are just a small set of examples, and not all properties shown are
relevant to all connection types and servers.
Table 15. Examples of name mapping for connection factory and destination properties
WebSphere service
WebSphere MQ JMS integration bus property
property name XMS property name name
PERSISTENCE (PER) XMSC_DELIVERY_MODE
EXPIRY (EXP) XMSC_TIME_TO_LIVE
PRIORITY (PRI) XMSC_PRIORITY
XMSC_WPM_HOST_NAME serverName
XMSC_WPM_BUS_NAME busName
XMSC_WPM_TOPIC_SPACE topicName
The properties listed in the following tables are the minimum required for an
application to set to create a connection to a messaging server. If you want to
customize the way that a connection is created, then your application can set any
additional properties of the ConnectionFactory object as necessary. For further
information, and a complete list of available properties, see “Properties of
ConnectionFactory” on page 404.
For further details about the different types of administered object repository that
XMS supports, see “Supported types of administered object repository” on page 83.
To create the administered objects for WebSphere MQ, use the WebSphere MQ
Explorer or WebSphere MQ JMS administration (JMSAdmin) tool.
To create the administered objects for WebSphere MQ, WebSphere Event Broker, or
WebSphere Message Broker, use the WebSphere MQ JMS administration
(JMSAdmin) tool.
To create administered objects for WebSphere service integration bus, use the
WebSphere Application Server administrative console.
InitialContext objects
An application must create an initial context to be used to make a connection to
the administered objects repository to retrieve the required administered objects.
InitialContext properties
The parameters of the InitialContext constructor include the location of the
repository of administered objects, given as a uniform resource indicator (URI). In
order for an application to establish a connection to the repository, it may be
necessary to provide more information than the information contained in the URI.
The following properties are passed unmodified to the Web service which will use
them to use to connect to the JNDI directory.
v XMSC_IC_PROVIDER_URL
v XMSC_IC_SECURITY_CREDENTIALS
v XMSC_IC_SECURITY_AUTHENTICATION
v XMSC_IC_SECURITY_PRINCIPAL
v XMSC_IC_SECURITY_PROTOCOL
FileSystem context
For the FileSystem context, the URL gives the location of the file system based
directory. The structure of the URL is as defined by RFC 1738, Uniform Resource
Locators (URL): the URL has the prefix file://, and the syntax following this prefix
is a valid definition of a file that can be opened on the system on which XMS is
running.
This syntax can be platform-specific, and can use either ’/ separators or ’\’
separators. If you use ’\’, then each separator needs to be escaped by using an
additional ’\’. This prevents the C runtime from trying to interpret the separator as
an escape character for what follows. Furthermore, if the URI is coded as literal C
strings in source code, the compiler also requires each ’\’ character to be escaped.
The following examples show the syntax written as literal C strings within source
code:
"file://c:\\\\admin\\\\.bindings"
"file://\\\\\\\\madison\\\\shared\\\\admin\\\\.bindings"
For the LDAP context, the basic structure of the URL is as defined by RFC 2255,
The LDAP URL Format, with the case-insensitive prefix ldap://
This syntax is as defined in the RFC but without support for any attributes, scope,
filters, or extensions.
WSS context
For the WSS context, the URL is in the form of a Web services endpoint, with the
prefix http://.
These two prefixes are interpreted as meaning that you are using a WSS context
with the URL accessed over http, which enables the initial context type to be
derived easily directly from the URL.
To define the Web service within XMS applications, you simply need to set the
XMSC_IC_URL property of the InitialContext object to the Web service endpoint
URL. For example, if the Web service is deployed on a server host called MyServer,
an example of a Web service endpoint URL:
wsvc://MyHost:9080/SIBXJndiLookup/services/JndiLookup
The protocol used in the encryption negotiation can be either Secure Sockets Layer
(SSL) or Transport Layer Security (TLS), depending on which CipherSuite you
specify in the ConnectionFactory object.
If you use the WebSphere MQ Version 7.0.0.1 and above client libraries and
connect to a WebSphere MQ Version 7 queue manager, then you can create
multiple connections to same queue manager in XMS application. However
connection to different queue manager is not permitted. If you attempt you get the
MQRC_SSL_ALREADY_INITIALIZED error.
If you use the WebSphere MQ Version 6 and above client libraries, then you can
create a new SSL connection only if you close any previous SSL connection first.
Multiple concurrent SSL connections from the same process to the same or
different queue managers are not permitted. If you attempt more than one request,
you get the warning MQRC_SSL_ALREADY_INITIALIZED, which might mean that some
requested parameters for the SSL connection were ignored.
Table 21 lists the available CipherSpecs and their JSSE CipherSuite equivalents.
Table 21. Available CipherSpecs and their JSSE CipherSuite equivalents
CipherSpec Equivalent JSSE CipherSuite
DES_SHA_EXPORT SSL_RSA_WITH_DES_CBC_SHA
DES_SHA_EXPORT1024 SSL_RSA_EXPORT1024_WITH_DES_CBC_SHA
FIPS_WITH_3DES_EDE_CBC_SHA SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA
FIPS_WITH_DES_CBC_SHA SSL_RSA_FIPS_WITH_DES_CBC_SHA
NULL_MD5 SSL_RSA_WITH_NULL_MD5
NULL_SHA SSL_RSA_WITH_NULL_SHA
RC2_MD5_EXPORT SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5
RC4_56_SHA_EXPORT1024 SSL_RSA_EXPORT1024_WITH_RC4_56_SHA
RC4_MD5_EXPORT SSL_RSA_EXPORT_WITH_RC4_40_MD5
RC4_MD5_US SSL_RSA_WITH_RC4_128_MD5
RC4_SHA_US SSL_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA SSL_RSA_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA SSL_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA SSL_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_DES_CBC_SHA SSL_RSA_WITH_DES_CBC_SHA
XMS provides SSL and HTTPS support for connections to a WebSphere service
integration bus. SSL and HTTPS provide secure connections for authentication and
confidentiality.
Like WebSphere security, XMS security is configured with respect to JSSE security
standards and naming conventions, which include the use of CipherSuites to
specify the algorithms that are used when negotiating a secure connection. The
protocol used in the encryption negotiation can be either SSL or TLS, depending on
which CipherSuite you specify in the ConnectionFactory object.
Table 24 lists the properties that must be defined in the ConnectionFactory object.
Table 24. Properties of ConnectionFactory for secure connections to a WebSphere service integration bus messaging
engine
Name of property Description
XMSC_WPM_SSL_CIPHER_SUITE The name of the CipherSuite to be used on an SSL or TLS
connection to a WebSphere service integration bus messaging
engine. The protocol used in negotiating the secure
connection depends on the specified CipherSuite.
XMSC_WPM_SSL_KEY_REPOSITORY A path to the file that is the keyring file containing the public
or private keys to be used in the secure connection.
XMSC_WPM_SSL_KEYRING_LABEL The certificate to be used when authenticating with the server.
XMSC_WPM_SSL_KEYRING_PW The password for the keyring file.
XMSC_WPM_SSL_KEYRING_STASH_FILE The name of a binary file containing the password of the key
repository file.
XMSC_WPM_SSL_FIPS_REQUIRED The value of this property determines whether an application
can or cannot use non-FIPS compliant cipher suites. If this
property is set to true, only FIPS algorithms are used for the
client-server connection.
An application can select which messages it wants to receive. It does this by using
message selectors, which specify the selection criteria. The criteria can be based on
the values of certain header fields and the values of any of the properties of a
message. For more information about message selectors, see “Message selectors”
on page 106.
The names of these header fields commence with the prefix JMS. For a description
of the JMS message header fields, see the Java Message Service Specification, Version
1.1.
XMS implements the JMS message header fields as attributes of a Message object.
Each header field has its own methods for setting and getting its value. For a
description of these methods, see “Message” on page 179 for C, or “Message” on
page 317 for C++. A header field is always readable and writable.
In addition to the predefined properties, an XMS application can create and use its
own set of message properties. These properties are called application defined
properties.
For information about getting and setting the properties of messages, see “Object
Properties in C” on page 64 or “Properties in C++” on page 73.
The received message, when forwarded after clearing up the message properties,
will behave in a manner consistent with the behavior of forwarding a standard
WMQ XMS for C/C++ BytesMessage with message properties cleared up.
This is, however, not recommended since the following properties will be lost:
v JMS_IBM_Encoding property value, implying that the message data cannot be
decoded meaningfully.
v JMS_IBM_Format property value, implying that the header chaining between the
(MQMD or the new MQRFH2) message header and existing headers would be
broken.
To determine the values of all the properties of a message, an application can call
the Get Properties method of the Message class. The method creates an iterator
that encapsulates a list of Property objects, where each Property object represents a
property of the message. The application can then use the methods of the Iterator
class to retrieve each Property object in turn, and it can use the methods of the
Property class to retrieve the name, data type, and value of each property. For a
sample fragment of C code that performs a similar function, see “Iterators” on
page 54.
Table 27 lists the JMS-defined properties of a message that are supported by both
XMS and WebSphere JMS. For a description of the JMS-defined properties, see Java
Message Service Specification, Version 1.1. The JMS-defined properties are not valid
for a real-time connection to a broker.
The table specifies the data type of each property and indicates how the value of
the property is set for a transmitted message. Some of the properties are set
automatically by XMS when an application sends a message or, in the case of
JMSXDeliveryCount, when an application receives a message.
Table 27. JMS-defined properties of a message
XMS name of the JMS How the value is set for a transmitted
defined property JMS name Data type message (in the format method [class])
JMSX_APPID JMSXAppID String Send [MessageProducer]
JMSX_DELIVERY_COUNT JMSXDeliveryCount xmsINT Receive [MessageConsumer]
JMSX_GROUPID JMSXGroupID String Set String Property [PropertyContext]
JMSX_GROUPSEQ JMSXGroupSeq xmsINT Set Integer Property [PropertyContext]
JMSX_USERID JMSXUserID String Send [MessageProducer]
Table 28 lists the IBM defined properties of a message that are supported by both
XMS and WebSphere JMS. For more information about the IBM-defined properties,
see WebSphere MQ Using Java or the WebSphere Application Server Information
Center.
The table specifies the data type of each property and indicates how the value of
the property is set for a transmitted message. Some of the properties are set
automatically by XMS when an application sends a message.
Table 28. IBM-defined properties of a message
How the value is set
for a transmitted
XMS name of the IBM defined message (in the
property WebSphere JMS name Data type format method [class])
JMS_IBM_CHARACTER_SET JMS_IBM_Character_Set xmsINT Set Integer Property
[PropertyContext]
JMS_IBM_ENCODING JMS_IBM_Encoding xmsINT Set Integer Property
[PropertyContext]
JMS_IBM_EXCEPTIONMESSAGE JMS_IBM_ExceptionMessage String Receive
[MessageConsumer]
JMS_IBM_EXCEPTIONREASON JMS_IBM_ExceptionReason xmsINT Receive
[MessageConsumer]
JMS_IBM_EXCEPTIONTIMESTAMP JMS_IBM_ExceptionTimestamp xmsLONG Receive
[MessageConsumer]
JMS_IBM_EXCEPTIONPROBLEM JMS_IBM_ExceptionProblemDestination String Receive
DESTINATION [MessageConsumer]
JMS_IBM_FEEDBACK JMS_IBM_Feedback xmsINT Set Integer Property
[PropertyContext]
JMS_IBM_FORMAT JMS_IBM_Format String Set String Property
[PropertyContext]
JMS_IBM_LAST_MSG_IN_GROUP JMS_IBM_Last_Msg_In_Group xmsBOOL Set Integer Property
[PropertyContext]
JMS_IBM_MSGTYPE JMS_IBM_MsgType xmsINT Set Integer Property
[PropertyContext]
JMS_IBM_PUTAPPLTYPE JMS_IBM_PutApplType xmsINT Send
[MessageProducer]
JMS_IBM_PUTDATE JMS_IBM_PutDate String Send
[MessageProducer]
JMS_IBM_PUTTIME JMS_IBM_PutTime String Send
[MessageProducer]
JMS_IBM_REPORT_COA JMS_IBM_Report_COA xmsINT Set Integer Property
[PropertyContext]
JMS_IBM_REPORT_COD JMS_IBM_Report_COD xmsINT Set Integer Property
[PropertyContext]
JMS_IBM_REPORT_DISCARD_MSG JMS_IBM_Report_Discard_Msg xmsINT Set Integer Property
[PropertyContext]
For information about the size and maximum and minimum values of each of
these data types, see Table 9 on page 52.
For this reason, each element of application data written in the body of a message
by an XMS application must have one of the data types listed in Table 29 on page
103. For each XMS data type, the table shows the compatible Java data type. XMS
For information about the size, maximum value and minimum value of each of
these data types, see “XMS primitive types” on page 52.
Bytes messages
The body of a bytes message contains a stream of bytes. The body contains only
the actual data, and it is the responsibility of the sending and receiving
applications to interpret this data.
After an application creates a bytes message, the body of the message is write-only.
The application assembles the application data into the body by calling the
appropriate write methods of the BytesMessage class. Each time the application
writes a value to the bytes message stream, the value is assembled immediately
after the previous value written by the application. XMS maintains an internal
cursor to remember the position of the last byte that was assembled.
When the application sends the message, the body of the message becomes
read-only. In this mode, the application can send the message repeatedly.
In the case of C only, an application can skip over bytes without reading them by
calling a read function with a null pointer for the value parameter or by calling
xmsBytesMsgReadBytes(). For information about how to skip over a string, see
“xmsBytesMsgReadUTF – Read UTF String” on page 139.
If an application calls the Reset method of the BytesMessage class when the body
of a bytes message is write-only, the body becomes read-only. The method also
repositions the cursor at the beginning of the bytes message stream.
Map messages
The body of a map message contains a set of name-value pairs, where each value
has an associated data type.
In each name-value pair, the name is a string that identifies the value, and the
value is an element of application data that has one of the XMS data types listed in
Table 29 on page 103. The order of the name-value pairs is not defined. The
MapMessage class contains the methods to set and get name-value pairs.
When an application gets the value of a name-value pair, the value can be
converted by XMS into another data type. For example, to get an integer from the
body of a map message, an application can call the Get String method of the
MapMessage class, which returns the integer as a string. The supported
conversions are the same as those that are supported when XMS converts a
property value from one data type to another. For more information about the
supported conversions, see “Implicit conversion of a property value from one data
type to another” on page 52.
After an application creates a map message, the body of the message is readable
and writable. The body remains readable and writable after the application sends
the message. When an application receives a map message, the body of the
message is read-only. If an application calls the Clear Body method of the Message
class when the body of a map message is read-only, the body becomes readable
and writable. The method also clears the body.
Object messages
The body of an object message contains a serialized Java or .NET object.
An XMS application can receive an object message, change its header fields and
properties, and then send it to another destination. An application can also copy
the body of an object message and use it to form another object message. XMS
treats the body of an object message as an array of bytes.
After an application creates an object message, the body of the message is readable
and writable. The body remains readable and writable after the application sends
the message. When an application receives an object message, the body of the
message is read-only. If an application calls the Clear Body method of the Message
class for C or C++ when the body of an object message is read-only, the body
becomes readable and writable. The method also clears the body.
The data type of a value is one of the XMS data types listed in Table 29 on page
103.
When the application sends the message, the body of the message becomes
read-only. In this mode, the application can send the message multiple times.
Using the C interface only, an application can skip over a value without reading it
by calling a read function with a null pointer for the value parameter or by calling
xmsStreamMsgReadBytes() or xmsStreamMsgReadObject() for the buffer parameter.
For information about how to skip over a value that is a string, see
“xmsStreamMsgReadString – Read String” on page 262.
When an application reads a value from the message stream, the value can be
converted by XMS into another data type. For example, to read an integer from the
message stream, an application can call the Read String method, which returns the
integer as a string. The supported conversions are the same as those that are
supported when XMS converts a property value from one data type to another. For
more information about the supported conversions, see “Implicit conversion of a
property value from one data type to another” on page 52.
If an application calls the Reset method of the StreamMessage class for C or C++
when the body of a stream message is write-only, the body becomes read-only. The
method also repositions the cursor at the beginning of the message stream.
If an application calls the Clear Body method of the Message class for C or C++
when the body of a stream message is read-only, the body becomes write-only. The
method also clears the body.
Text messages
The body of a text message contains a string.
After an application creates a text message, the body of the message is readable
and writable. The body remains readable and writable after the application sends
Message selectors
An XMS application uses messages selectors to select the messages it wants to
receives.
An application can create more than one message consumer, each with its own
message selector expression. If an incoming message meets the selection criteria of
more than one message consumer, XMS delivers the message to each of these
consumers.
The syntax rules for forming a message selector expression in XMS are the same as
those in WebSphere MQ JMS. For information about how to construct a message
selector expression, see WebSphere MQ Using Java. Note that, in a message selector
expression, the names of JMS-defined properties must be the JMS names, and the
names of IBM-defined properties must be the WebSphere MQ JMS names. You
cannot use the XMS names in a message selector expression.
WebSphere MQ messages received from a queue manager are mapped onto XMS
messages in the same way that WebSphere MQ messages are mapped onto
WebSphere MQ JMS messages in similar circumstances.
If an application calls a C API function and the call fails, a response with a return
code other than XMS_OK is returned with an XMS error block containing more
information about the reason for the failure. For further details, see “Return codes”
on page 67 and “ErrorBlock” on page 157.
Some error conditions are an indication that some resource is unavailable, and the
action that an application can take depends on the XMS function that the
application is calling. For example, if a connection fails to connect to the server,
then the application may wish to retry periodically until a connection is made. An
XMS error block or exception might not contain enough information to determine
what action to take, and, in these situations, there is often a linked error block or
exception that contains more specific diagnostic information.
In the C++ API, always include calls to methods in a try block and, to catch all
types of XMS exception, specify the Exception class in the catch construct. For
further details, see “Error handling in C++” on page 76.
The exception listener is an asynchronous error condition path that can be started
at any time. When the exception listener function is started, on its own thread, it is
usually an indication of a more severe failure than a normal XMS API error
condition. Any appropriate action may be taken, but you must be careful to follow
the rules for the XMS threading model as described in “The threading model” on
page 35.
The type of FFDC record that XMS generates depends on the type of failure that
has occurred. There are two distinct types of FFDC record:
v The first type of FFDC record is sometimes, but not always, generated as a result
of a user’s own application causing a failure, and usually results in the
application being terminated. This type of failure is often characterized in the
FFDC record as ’Unhandled Exception detected’ or ’SIGNAL xx received’. The
FFDC record contains detailed information describing the cause of the failure
and also contains a function stack back-trace which shows the failing function
stack.
v The second type of FFDC record is generated by XMS itself in cases where it has
detected an unexpected condition. Generally, the application continues to run
but, depending upon the reason for which the FFDC record was generated, XMS
API function calls may return negative responses.
Repeatable failures
If you are dealing with a repeatable failure, it might be necessary for you to
capture product trace over an extended period of time to allow the problem to be
diagnosed.
If you need to provide a product trace, either enable trace as advised by the IBM
Support Center representative or as described in “FFDC and trace configuration for
C/C++ applications” on page 113.
It is important that the size of the trace file is large enough to capture the trace
while the repeatable problem occurs. To set the size of the trace file, either use
environment variable XMS_TRACE_FILE_SIZE or use the gxisc executable
command as follows:
alter trace(enabled) tracesize(xxxx)
Refer to Table 30 on page 113 for the descriptions of various environment variable
settings for C/C++ trace.
This is because trace wraps, which means that leaving trace on would eventually
cause the trace at the point of failure to be lost.
If you are experiencing problems where you do not have access to the information
provided in the error block, you may want to enable the
XMS_FFDC_EXCEPTIONS environment variable. This produces an FFDC record
whenever the XMS API returns an error from a function. The FFDC record contains
full details of the XMS error block to assist in debugging failures.
Refer to “FFDC and trace configuration for C/C++ applications” for more
information on the gxisc and gxitrcfmt commands.
XMS creates FFDC records and trace files in the current working directory, unless
you specify an alternative location by configuring an XMS environment variable as
described below.
To configure trace for an XMS C or C++ application, set the following XMS
environment variables before running the application:
Table 30. Environment variable settings for C/C++ trace
Environment variables Default Settings Meaning
XMS_TRACE_ON Not applicable normal Selected components are traced.
full All components are traced.
partial A comma separated list of component identifiers to
trace. For example, ″partial,osa,cal″ only traces XMS
components gxiosa and gxical. Use full trace to show
the components that can be traced.
XMS_TRACE_FILE_PATH Current /dirpath/ The directory path that trace and FFDC records are
working written to.
directory
XMS creates FFDC and trace files in the current
working directory, unless you specify an alternative
location by setting the environment variable
XMS_TRACE_FILE_PATH to the fully qualified path
name of the directory where you want XMS to create
the FFDC and trace files. You must set this environment
variable before you start the application that you want
to trace, and you must make sure that the user identifier
under which the application runs has the authority to
write to the directory where XMS creates the FFDC and
trace files.
To configure trace dynamically, use the executable gxisc. You can use gxisc to
enable and disable trace in a running XMS C or C++ application, and to modify
the trace size. You must run gxisc on the same machine as the XMS application.
To invoke gxisc, use the process id of the XMS application for which you want to
alter the trace configuration, as shown in the example below.
gxisc 1234 <enter>
display all <enter>
alter trace(enabled) tracesize(100) <enter>
help <enter>
alter trace(disabled) <enter>
alter <enter>
end
gxisc <enter>
alter pid(1234) trace(enabled) <enter>
end
Note: Trace settings are not retained after the XMS C or C++ application
terminates.
The XMS C/C++ client may have different behavior from that of theWebSphere
MQ JMS client. Therefore, you may find that your XMS application cannot connect
to your queue manager, although your JMS application can.
v A simple solution to this problem is to try using a userid that is no more than 12
characters long and is authorized completely in the queue manager’s authority
list. If this solution is not ideal, a different but more complex approach would be
to use security exits. If you need further help on this issue, contact IBM Support
for assistance.
v If you set the XMSC_USERID property of the connection factory, it must match
the userid and password of the logged on user. If you do not set this property,
the queue manager will use the userid of the logged on user by default.
The definition of each function lists the exception codes that XMS might return if it
detects an error while processing a call to the function. Each exception code is
represented by its named constant.
BytesMessage
A bytes message is a message whose body comprises a stream of bytes.
Functions
xmsBytesMsgGetBodyLength – Get Body Length
Interface:
xmsRC xmsBytesMsgGetBodyLength(xmsHMsg message,
xmsLONG *bodyLength,
xmsHErrorBlock errorBlock);
Get the length of the body of the message when the body of the message is
read-only.
Parameters:
message (input)
The handle for the message.
bodyLength (output)
The length of the body of the message in bytes. The function
returns the length of the whole body regardless of where the
cursor for reading the message is currently positioned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
Read the next byte from the bytes message stream as a signed 8-bit integer.
Parameters:
message (input)
The handle for the message.
value (output)
The byte that is read. If you specify a null pointer on input, the
function skips over the byte without reading it.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read an array of bytes from the bytes message stream starting from the current
position of the cursor.
Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the array of bytes that is read. If the number
of bytes remaining to be read from the stream before the call is
greater than or equal to the length of the buffer, the buffer is filled.
Otherwise, the buffer is partially filled with all the remaining
bytes.
If you specify a null pointer on input, the function skips over the
bytes without reading them. If the number of bytes remaining to
be read from the stream before the call is greater than or equal to
the length of the buffer, the number of bytes skipped is equal to
the length of the buffer. Otherwise, all the remaining bytes are
skipped.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, no bytes are read into the buffer, but the number of bytes
remaining in the stream, starting from the current position of the
cursor, is returned in the returnedLength parameter, and the cursor
is not advanced.
returnedLength (output)
The number of bytes that are read into the buffer. If the buffer is
partially filled, the value is less than the length of the buffer,
indicating that there are no more bytes remaining to be read. If
there are no bytes remaining to be read from the stream before the
call, the value is XMSC_END_OF_STREAM.
If you specify a null pointer on input, the function returns no
value.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
message (input)
The handle for the message.
stream (output)
A pointer to the start of the bytes message stream.
length (output)
The number of bytes in the bytes message stream.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
Read the next 2 bytes from the bytes message stream as a character.
Parameters:
message (input)
The handle for the message.
value (output)
The character that is read. If you specify a null pointer on input,
the function skips over the bytes without reading them.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 4 bytes from the bytes message stream as a floating point number.
Parameters:
message (input)
The handle for the message.
value (output)
The floating point number that is read. If you specify a null pointer
on input, the function skips over the bytes without reading them.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 4 bytes from the bytes message stream as a signed 32-bit integer.
Parameters:
Read the next 8 bytes from the bytes message stream as a signed 64-bit integer.
Parameters:
message (input)
The handle for the message.
value (output)
The long integer that is read. If you specify a null pointer on input,
the function skips over the bytes without reading them.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 2 bytes from the bytes message stream as a signed 16-bit integer.
Parameters:
message (input)
The handle for the message.
value (output)
The short integer that is read. If you specify a null pointer on
input, the function skips over the bytes without reading them.
Read the next byte from the bytes message stream as an unsigned 8-bit integer.
Parameters:
message (input)
The handle for the message.
value (output)
The byte that is read. If you specify a null pointer on input, the
function skips over the byte without reading it.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 2 bytes from the bytes message stream as an unsigned 16-bit integer.
Parameters:
message (input)
The handle for the message.
value (output)
The unsigned short integer that is read. If you specify a null
pointer on input, the function skips over the bytes without reading
them.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
138 Message Service Client for C/C++
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read a string, encoded in UTF-8, from the bytes message stream. If required, XMS
converts the characters in the string from UTF-8 into the local code page.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the string that is read. If data conversion is
required, this is the string after conversion.
bufferLength (input)
The length of the buffer in bytes.
If you specify XMSC_QUERY_SIZE, the string is not returned, but its
length is returned in the actualLength parameter, and the cursor is
not advanced.
If you specify XMSC_SKIP, the function skips over the string without
reading it.
actualLength (output)
The length of the string in bytes. If data conversion is required,
this is the length of the string after conversion. If you specify a
null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Notes:
1. If the buffer is not large enough to store the whole string, XMS returns
the string truncated to the length of the buffer, sets the actualLength
parameter to the actual length of the string, and returns an error. XMS
does not advance the internal cursor.
2. If any other error occurs while attempting to read the string, XMS
reports the error but does not set the actualLength parameter or
advance the internal cursor.
Put the body of the message into read-only mode and reposition the cursor at the
beginning of the bytes message stream.
Parameters:
message (input)
The handle for the message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
Write a character to the bytes message stream as 2 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The character to be written.
Convert a double precision floating point number to a long integer and write the
long integer to the bytes message stream as 8 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The double precision floating point number to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a floating point number to an integer and write the integer to the bytes
message stream as 4 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The floating point number to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write an integer to the bytes message stream as 4 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The integer to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a long integer to the bytes message stream as 8 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The long integer to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a short integer to the bytes message stream as 2 bytes, high order byte first.
Write a string, encoded in UTF-8, to the bytes message stream. If required, XMS
converts the characters in the string from the local code page into UTF-8.
Parameters:
message (input)
The handle for the message.
value (input)
A character array containing the string to be written.
length (input)
The length of the string in bytes. If the string is null terminated
with no embedded null characters, you can specify
XMSC_CALCULATE_STRING_SIZE instead and allow XMS to calculate
its length.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Connection
A Connection object represents an application’s active connection to a broker.
For a list of the XMS defined properties of a Connection object, see “Properties of
Connection” on page 403.
Functions
xmsConnClose – Close Connection
Interface:
Create a session.
Parameters:
connection (input)
The handle for the connection.
transacted (input)
The value xmsTRUE means that the session is transacted. The value
xmsFALSE means that the session is not transacted.
For a real-time connection to a broker, the value must be xmsFALSE.
acknowledgeMode (input)
Indicates how messages received by an application are
acknowledged. The value must be one of the following
acknowledgement modes:
XMSC_AUTO_ACKNOWLEDGE
XMSC_CLIENT_ACKNOWLEDGE
XMSC_DUPS_OK_ACKNOWLEDGE
For a real-time connection to a broker, the value must be
XMSC_AUTO_ACKNOWLEDGE or XMSC_DUPS_OK_ACKNOWLEDGE.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
connection (input)
The handle for the connection.
clientID (output)
The buffer to contain the client identifier.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the client identifier is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the client identifier in bytes. If data conversion is
required, this is the length of the client identifier after conversion.
If you specify a null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get pointers to the exception listener function and context data that are registered
with the connection.
Set a client identifier for the connection. A client identifier is used only to support
durable subscriptions in the publish/subscribe domain, and is ignored in the
point-to-point domain.
Register an exception listener function and context data with the connection.
For more information about using exception listener functions, see “Exception
listener functions in C” on page 69.
Parameters:
connection (input)
The handle for the connection.
lsr (input)
A pointer to the exception listener function. If an exception listener
function is already registered with the connection, you can cancel
the registration by specifying a null pointer instead.
context (input)
A pointer to the context data.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
Start, or restart the delivery of incoming messages for the connection. The call is
ignored if the connection is already started.
Parameters:
connection (input)
The handle for the connection.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Stop the delivery of incoming messages for the connection. The call is ignored if
the connection is already stopped.
Parameters:
connection (input)
The handle for the connection.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
ConnectionFactory
An application uses a connection factory to create a connection.
Functions
xmsConnFactCreate – Create Connection Factory
Interface:
xmsRC xmsConnFactCreate(xmsHConnFact *factory,
xmsHErrorBlock errorBlock);
If you are connecting to WebSphere MQ, and you set the XMSC_USERID property
of the connection factory, it must match the userid of the logged on user. If you do
not set these properties, the queue manager will use the userid of the logged on
user by default. If you require further connection-level authentication of individual
users you can write a client authentication exit which is configured in WebSphere
MQ. You can learn more about creating a client authentication exit in the
Authentication topic in the WebSphere MQ Clients manual.
The connection is created in stopped mode. No messages are delivered until the
application calls xmsConnStart().
Parameters:
factory (input)
The handle for the connection factory.
connection (output)
The handle for the connection.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_SECURITY_EXCEPTION
If you are connecting to WebSphere MQ, and you set the XMSC_USERID property
of the connection factory, it must match the userid of the logged on user. If you do
not set these properties, the queue manager will use the userid of the logged on
user by default. If you require further connection-level authentication of individual
users you can write a client authentication exit which is configured in WebSphere
MQ. You can learn more about creating a client authentication exit in the
Authentication topic in the WebSphere MQ Clients manual.
The connection is created in stopped mode. No messages are delivered until the
application calls xmsConnStart().
Parameters:
factory (input)
The handle for the connection factory.
userID (input)
The user identifier to be used to authenticate the application. The
user identifier is in the format of a null terminated string. If the
user identifier is null, the connection factory property
XMSC_USERID is used instead.
password (input)
The password to be used to authenticate the application. The
password is in the format of a null terminated string. If the
password is null, the connection factory property
XMSC_PASSWORD is used instead.
connection (output)
The handle for the connection.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_SECURITY_EXCEPTION
If an application tries to delete a connection factory that is already deleted, the call
is ignored.
Parameters:
factory (input/output)
On input, the handle for the connection factory. On output, the
function returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
ConnectionMetaData
A ConnectionMetaData object provides information about a connection.
Functions
xmsConnMetaDataGetJMSXProperties – Get JMS Defined
Message Properties
Interface:
xmsRC
xmsConnMetaDataGetJMSXProperties(xmsHConnMetaData connectionMetaData,
xmsHIterator *iterator,
xmsHErrorBlock errorBlock);
Get a list of the names of the JMS defined message properties supported by the
connection.
The function returns an iterator that encapsulates a list of Property objects, where
each Property object encapsulates the name of a JMS defined message property.
The application can then use the iterator to retrieve the name of each JMS defined
message property in turn.
Note: The equivalent JMS method performs a slightly different function. The JMS
method returns an enumeration of the names of the JMS defined message
properties.
Parameters:
connectionMetaData (input)
The handle for the connection metadata.
iterator (output)
The handle for the iterator.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Destination
A destination is where an application sends messages, or it is a source from which
an application receives messages, or both.
For a list of the XMS defined properties of a Destination object, see “Properties of
Destination” on page 409.
For a destination that is a queue, this function does not create the queue in the
messaging server. You must create the queue before an application can call this
function.
Parameters:
URI (input)
The URI in the format of a null terminated string.
destination (output)
The handle for the destination.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For a destination that is a queue, this function does not create the queue in the
messaging server. You must create the queue before an application can call this
function.
Parameters:
destinationType (input)
The type of the destination, which must be one of the following
values:
XMS_DESTINATION_TYPE_QUEUE
XMS_DESTINATION_TYPE_TOPIC
destinationName (input)
The name of the destination, which can be the name of a queue or
the name of a topic. The name is in the format of a null terminated
string.
The scope of the temporary destination is the connection. Only the sessions created
by the connection can use the temporary destination.
For a destination that is a queue, this function does not delete the queue in the
messaging server unless the queue was created for an XMS temporary queue.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
destination (input)
The handle for the destination.
destinationName (output)
The buffer to contain the name of the destination. The name is
either the name of a queue or the name of a topic.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the name of the destination is not returned, but its length
is returned in the actualLength parameter.
actualLength (output)
The length of the name of the destination in bytes. If you specify a
null pointer on input, the length is not returned.
Get the name of the destination in the format of a uniform resource identifier
(URI).
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
destination (input)
The handle for the destination.
destinationName (output)
The buffer to contain the URI. The URI is either a queue URI or a
topic URI.
ErrorBlock
If a C function call fails, XMS can store information about why the call failed in an
error block.
For more information about the error block and its contents, see “The error block”
on page 67.
Functions
xmsErrorClear – Clear Error Block
Interface:
xmsRC xmsErrorClear(xmsHErrorBlock errorBlock);
Note that XMS automatically clears the contents of an error block that is passed by
an API function call.
Parameters:
errorBlock (input)
The handle for the error block.
Thread context:
Any
Only the first error block in a chain of error blocks can be explicitly deleted. By
deleting the first error block in a chain, all subsequent error blocks in the chain are
also deleted.
If an application tries to delete an error block that is already deleted, the call is
ignored.
Parameters:
errorBlock (input/output)
On input, the handle for the error block. On output the function
returns a null handle.
Thread context:
Any
For more information about the error code, see “The error block” on page 67.
Parameters:
errorBlock (input)
The handle for the error block.
errorCode (output)
The error code.
Thread context:
Any
For more information about the error data, see “The error block” on page 67.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
errorBlock (input)
The handle for the error block.
buffer (output)
The buffer to contain the error data.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the error data is not returned, but its length is returned in
the actualLength parameter.
actualLength (output)
The length of the error data in bytes. If you specify a null pointer
on input, the length is not returned.
Thread context:
Any
For more information about the error string, see “The error block” on page 67.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
errorBlock (input)
The handle for the error block.
buffer (output)
The buffer to contain the error string.
For more information about the exception code, see “The error block” on page 67.
Parameters:
errorBlock (input)
The handle for the error block.
exceptionCode (output)
The exception code. If the error block is in a chain of error blocks,
but is not the first in the chain, the exception code is always
XMS_X_GENERAL_EXCEPTION.
Thread context:
Any
Get the handle for the next error block in the chain of error blocks.
Parameters:
errorBlock (input)
The handle for the error block.
linkedError (output)
The handle for the next error block in the chain. The function
returns a null handle if there are no more error blocks in the chain.
Thread context:
Any
Functions
onException – On Exception
Interface:
xmsVOID onException(xmsCONTEXT context,
xmsHErrorBlock errorBlock);
For more information about using exception listener functions, see “Exception
listener functions in C” on page 69.
Parameters:
context (input)
A pointer to the context data that is registered with the connection.
errorBlock (input)
The handle for an error block created by XMS.
InitialContext
An application uses an InitialContext object to create objects from object definitions
that are retrieved from a repository of administered objects.
For a list of the XMS defined properties of an InitialContext object, see “Properties
of InitialContext” on page 410.
Functions
xmsInitialContextCreate – Create Initial Context
Interface:
xmsRC xmsInitialContextCreate(xmsCHAR *URL,
xmsHInitialContect *initalContext,
xmsHErrorBlock errorBlock);
Create an object from an object definition that is retrieved from the repository of
administered objects.
Parameters:
initialContext (input)
The handle for the InitialContext object.
objectName (input)
The name of the administered object in the format of a null
terminated string.
returnedObject (output)
The handle for the object that is created.
Iterator
An iterator encapsulates a list of objects. An application uses an iterator to access
each object in turn.
An iterator also encapsulates a cursor that maintains the current position in the
list. When an iterator is created, the position of the cursor is before the first object.
Functions
xmsIteratorDispose – Delete Iterator
Interface:
xmsRC xmsIteratorDispose(xmsHIterator *iterator,
xmsHErrorBlock errorBlock);
Move the cursor to the next object and get the object at the new position of the
cursor.
Parameters:
iterator (input)
The handle for the iterator.
object (output)
The handle for the object.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether there are any more objects beyond the current position of the
cursor. The call does not move the cursor.
Parameters:
iterator (input)
The handle for the iterator.
moreProperties (output)
The value is xmsTRUE if there are more objects beyond the current
position of the cursor. The value is xmsFALSE if there are no more
objects beyond the current position of the cursor.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
MapMessage
A map message is a message whose body comprises a set of name-value pairs,
where each value has an associated data type.
When an application gets the value of name-value pair, the value can be converted
by XMS into another data type. For more information about this form of implicit
conversion, see “Map messages” on page 104.
Functions
xmsMapMsgGetBoolean – Get Boolean Value
Interface:
xmsRC xmsMapMsgGetBoolean(xmsHMsg message,
xmsCHAR *name,
xmsBOOL *value,
xmsHErrorBlock errorBlock);
Get the boolean value identified by name from the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the boolean value. The name is in the
format of a null terminated string.
value (output)
The boolean value retrieved from the body of the map message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the array of bytes identified by name from the body of the map message.
For more information about how to use this function, see “C functions that return
a byte array by value” on page 65.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the array of bytes. The name is in the
format of a null terminated string.
buffer (output)
The buffer to contain the array of bytes. No data conversion is
performed on the bytes that are returned.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the array of bytes is not returned, but its length is returned
in the actualLength parameter.
actualLength (output)
The number of bytes in the array. If you specify a null pointer on
input, the length of the array is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
Get a pointer to an array of bytes in the body of the map message and get the
length of the array. The array of bytes is identified by name.
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the array of bytes. The name is in the
format of a null terminated string.
array (output)
A pointer to the array of bytes.
length (output)
The number of bytes in the array.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the character identified by name from the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the character. The name is in the format of
a null terminated string.
value (output)
The character retrieved from the body of the map message.
Get the double precision floating point number identified by name from the body
of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the double precision floating point
number. The name is in the format of a null terminated string.
value (output)
The double precision floating point number retrieved from the
body of the map message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the floating point number identified by name from the body of the map
message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the floating point number. The name is in
the format of a null terminated string.
Get the integer identified by name from the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the integer. The name is in the format of a
null terminated string.
value (output)
The integer retrieved from the body of the map message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the long integer identified by name from the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the long integer. The name is in the
format of a null terminated string.
value (output)
The long integer retrieved from the body of the map message.
Get a list of the name-value pairs in the body of the map message.
The function returns an iterator that encapsulates a list of Property objects, where
each Property object encapsulates a name-value pair. The application can then use
the iterator to access each name-value pair in turn.
Note: The equivalent JMS method performs a slightly different function. The JMS
method returns an enumeration of only the names, not the values, in the
body of the map message.
Parameters:
message (input)
The handle for the message.
iterator (output)
The handle for the iterator.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the value of a name-value pair, and its data type, from the body of the map
message. The name-value pair is identified by name.
For more information about how to use this function, see “C functions that return
a byte array by value” on page 65.
Parameters:
message (input)
The handle for the message.
Get the short integer identified by name from the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the short integer. The name is in the
format of a null terminated string.
Get the string identified by name from the body of the map message.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the string. The name is in the format of a
null terminated string.
buffer (output)
The buffer to contain the string. If data conversion is required, this
is the string after conversion.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the string is not returned, but its length is returned in the
actualLength parameter.
actualLength (output)
The length of the string in bytes. If data conversion is required,
this is the length of the string after conversion. If you specify a
null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get a pointer to the string identified by name and get the length of the string.
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
message (input)
The handle for the message.
name (input)
The name that identifies the string. The name is in the format of a
null terminated string.
string (output)
A pointer to the string. If data conversion is required, this is the
string after conversion.
length (output)
The length of the string in bytes. If data conversion is required,
this is the length after conversion.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether the body of the map message contains a name-value pair with the
specified name.
Parameters:
message (input)
The handle for the message.
name (input)
The name of the name-value pair in the format of a null
terminated string.
pairExists (output)
The value is xmsTRUE if the body of the map message contains a
name-value pair with the specified name. The value is xmsFALSE if
the body of the map message does not contain a name-value pair
with the specified name.
errorBlock (input)
The handle for an error block or a null handle.
Chapter 14. C classes 173
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a double precision floating point number in the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name to identify the double precision floating point number in
the body of the map message. The name is in the format of a null
terminated string.
value (input)
The double precision floating point number to be set.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a value, with a specified data type, in the body of the map message.
Parameters:
message (input)
The handle for the message.
name (input)
The name to identify the value in the body of the map message.
The name is in the format of a null terminated string.
value (input)
An array of bytes containing the value to be set.
length (input)
The number of bytes in the array.
objectType (input)
The data type of the value, which must be one of the following
object types:
XMS_OBJECT_TYPE_BOOL
XMS_OBJECT_TYPE_BYTE
XMS_OBJECT_TYPE_BYTEARRAY
XMS_OBJECT_TYPE_CHAR
XMS_OBJECT_TYPE_DOUBLE
XMS_OBJECT_TYPE_FLOAT
XMS_OBJECT_TYPE_INT
XMS_OBJECT_TYPE_LONG
XMS_OBJECT_TYPE_SHORT
XMS_OBJECT_TYPE_STRING
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Message
A Message object represents a message that an application sends or receives.
For a list of the JMS message header fields in a Message object, see “Header fields
in an XMS message” on page 97. For a list of the JMS defined properties of a
Message object, see “JMS-defined properties of a message” on page 99. For a list of
the IBM defined properties of a Message object, see “IBM-defined properties of a
message” on page 100.
An application can call this function if the acknowledgement mode of the session
is XMSC_CLIENT_ACKNOWLEDGE. Calls to the function are ignored if the
session has any other acknowledgement mode or is transacted.
Messages that have been received but not acknowledged might be re-delivered.
Clear the body of the message. The header fields and message properties are not
cleared.
If an application clears a message body, the body is left in the same state as an
empty body in a newly created message. The state of an empty body in a newly
created message depends on the type of message body. For more information, see
“The body of an XMS message” on page 101.
An application can clear a message body at any time, no matter what state the
body is in. If a message body is read-only, the only way that an application can
write to the body is for the application to clear the body first.
Parameters:
message (input)
The handle for the message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
Clear the properties of the message. The header fields and the message body are
not cleared.
An application can clear the properties of a message at any time, no matter what
state the properties are in. If the properties of a message are read-only, the only
way that the properties can become writable is for the application to clear the
properties first.
Parameters:
message (input)
The handle for the message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
correlID (output)
The buffer to contain the correlation identifier.
length (input)
The length of the buffer in bytes. If you specify a length of 0, the
correlation identifier is not returned, but its length is returned in
the actualLength parameter.
actualLength (output)
The length of the correlation identifier in bytes. If you specify a
null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the delivery mode of the message. The delivery mode is set by the
xmsMsgProducerSend() call when the message is sent.
Parameters:
message (input)
The handle for the message.
deliveryMode (output)
The delivery mode of the message, which is one of the following
values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a newly created message that has not been sent, the delivery
mode is XMSC_DELIVERY_PERSISTENT, except for a real-time
connection to a broker for which the delivery mode is
XMSC_DELIVERY_NOT_PERSISTENT. For a message that has been
received, the function returns the delivery mode that was set by
The expiration time is set by the xmsMsgProducerSend() call when the message is
sent. Its value is calculated by adding the time to live, as specified by the sending
application, to the time when the message is sent. The expiration time is expressed
in milliseconds since 00:00:00 GMT on the 1 January 1970.
XMS discards expired messages and does not deliver them to applications.
Parameters:
message (input)
The handle for the message.
expiration (output)
The expiration time of the message.
For a newly created message that has not been sent, the expiration
time is 0 unless the sending application sets a different expiration
time by calling xmsMsgSetJMSExpiration(). For a message that has
been received, the function returns the expiration time that was set
by the xmsMsgProducerSend() call when the message was sent
unless the receiving application changes the expiration time by
calling xmsMsgSetJMSExpiration().
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the message identifier of the message. The message identifier is set by the
xmsMsgProducerSend() call when the message is sent.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
msgID (output)
The buffer to contain the message identifier.
For a message that has been received, the function returns the
message identifier that was set by the xmsMsgProducerSend() call
when the message was sent unless the receiving application
changes the message identifier by calling
xmsMsgSetJMSMessageID().
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the message identifier is not returned, but its length is
returned in the actualLength parameter.
Notes:
1. If a message has no message identifier, the function leaves the contents
of the buffer unchanged, sets the actualLength parameter to 0, and
returns an error.
Get the priority of the message. The priority is set by the xmsMsgProducerSend()
call when the message is sent.
Parameters:
message (input)
The handle for the message.
priority (output)
The priority of the message. The value is an integer in the range 0,
the lowest priority, to 9, the highest priority.
For a newly created message that has not been sent, the priority is
4 unless the sending application sets a different priority by calling
xmsMsgSetJMSPriority(). For a message that has been received, the
function returns the priority that was set by the
xmsMsgProducerSend() call when the message was sent unless the
receiving application changes the priority by calling
xmsMsgSetJMSPriority().
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the time when the message was sent. The time stamp is set by the
xmsMsgProducerSend() call when the message is sent and is expressed in
milliseconds since 00:00:00 GMT on the 1 January 1970.
Parameters:
message (input)
The handle for the message.
timeStamp (output)
The time when the message was sent.
Note:
1. If the time stamp is undefined, the function sets the timeStamp
parameter to 0 but returns no error.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
type (output)
The buffer to contain the type of the message. If data conversion is
required, this is the type after conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the type of the message is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the type of the message in bytes. If data conversion
is required, this is the length after conversion. If you specify a null
pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
The function returns an iterator that encapsulates a list of Property objects. The
application can then use the iterator to access each property in turn.
Note: The equivalent JMS method performs a slightly different function. The JMS
method returns an enumeration of only the names of the properties of the
message, not their values.
Parameters:
message (input)
The handle for the message.
iterator (output)
The handle for the iterator.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For information about message body types, see “The body of an XMS message” on
page 101.
Parameters:
message (input)
The handle for the message.
type (output)
The body type of the message, which is one of the following
values:
XMS_MESSAGE_TYPE_BASE (the message has no body)
XMS_MESSAGE_TYPE_BYTES
XMS_MESSAGE_TYPE_MAP
XMS_MESSAGE_TYPE_OBJECT
XMS_MESSAGE_TYPE_STREAM
XMS_MESSAGE_TYPE_TEXT
Check whether the message has a property with the specified name.
Parameters:
message (input)
The handle for the message.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyExists (output)
The value is xmsTRUE if the message has a property with the
specified name. The value is xmsFALSE if the message does not have
a property with the specified name.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A delivery mode set by this function before the message is sent is ignored and
replaced by the xmsMsgProducerSend() call when the message is sent. However,
you can use this function to change the delivery mode of a message that has been
received.
Parameters:
message (input)
The handle for the message.
deliveryMode (input)
The delivery mode of the message, which must be one of the
following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A destination set by this function before the message is sent is ignored and
replaced by the xmsMsgProducerSend() call when the message is sent. However,
you can use this function to change the destination of a message that has been
received.
Parameters:
message (input)
The handle for the message.
An expiration time set by this function before the message is sent is ignored and
replaced by the xmsMsgProducerSend() call when the message is sent. However,
you can use this function to change the expiration time of a message that has been
received.
Parameters:
message (input)
The handle for the message.
expiration (input)
The expiration time of the message expressed in milliseconds since
00:00:00 GMT on the 1 January 1970.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A message identifier set by this function before the message is sent is ignored and
replaced by the xmsMsgProducerSend() call when the message is sent. However,
you can use this function to change the message identifier of a message that has
been received.
Parameters:
message (input)
The handle for the message.
A priority set by this function before the message is sent is ignored and replaced
by the xmsMsgProducerSend() call when the message is sent. However, you can
use this function to change the priority of a message that has been received.
Parameters:
message (input)
The handle for the message.
priority (input)
The priority of the message. The value can be an integer in the
range 0, the lowest priority, to 9, the highest priority.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A time stamp set by this function before the message is sent is ignored and
replaced by the xmsMsgProducerSend() call when the message is sent. However,
you can use this function to change the time stamp of a message that has been
received.
Parameters:
message (input)
The handle for the message.
MessageConsumer
An application uses a message consumer to receive messages sent to a destination.
Functions
xmsMsgConsumerClose – Close Message Consumer
Interface:
xmsRC xmsMsgConsumerClose(xmsHMsgConsumer *consumer,
xmsHErrorBlock errorBlock);
If an application tries to close a message consumer that is already closed, the call is
ignored.
Get pointers to the message listener function and context data that are registered
with the message consumer.
For more information about using message listener functions, see “Message listener
functions in C” on page 68.
Parameters:
consumer (input)
The handle for the message consumer.
lsr (output)
A pointer to the message listener function. If no message listener
function is registered with the message consumer, the call returns a
null pointer.
context (output)
A pointer to the context data. If no message listener function is
registered with the connection, the call returns a null pointer.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
xmsMsgConsumerReceive – Receive
Interface:
xmsRC xmsMsgConsumerReceive(xmsHMsgConsumer consumer,
xmsHMsg *message,
xmsHErrorBlock errorBlock);
Receive the next message for the message consumer. The call waits indefinitely for
a message, or until the message consumer is closed.
Parameters:
consumer (input)
The handle for the message consumer.
message (output)
The handle for the message. If the message consumer is closed
while the call is waiting for a message, the function returns a null
handle.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Receive the next message for the message consumer if one is available
immediately.
Parameters:
consumer (input)
The handle for the message consumer.
message (output)
The handle for the message. If no message is available
immediately, the function returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Receive the next message for the message consumer. The call waits only a specified
period of time for a message, or until the message consumer is closed.
Parameters:
consumer (input)
The handle for the message consumer.
waitInterval (input)
The time, in milliseconds, that the call waits for a message. If you
specify a wait interval of 0, the call waits indefinitely for a
message.
message (output)
The handle for the message. If no message arrives during the wait
interval, or if the message consumer is closed while the call is
waiting for a message, the function returns a null handle but no
error.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Register a message listener function and context data with the message consumer.
For more information about using message listener functions, see “Message listener
functions in C” on page 68.
Parameters:
consumer (input)
The handle for the message consumer.
lsr (input)
A pointer to the message listener function. If a message listener
function is already registered with the message consumer, you can
cancel the registration by specifying a null pointer instead.
context (input)
A pointer to the context data.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
MessageListener
An application uses a message listener to receive messages asynchronously.
Functions
onMessage – On Message
Interface:
xmsVOID onMessage(xmsCONTEXT context,
xmsHMsg message);
onMessage() is the message listener function that is registered with the message
consumer. The name of the function does not have to be onMessage.
For more information about using message listener functions, see “Message listener
functions in C” on page 68.
Parameters:
context (input)
A pointer to the context data that is registered with the message
consumer.
message (input)
The handle for the message.
MessageProducer
An application uses a message producer to send messages to a destination.
Functions
xmsMsgProducerClose – Close Message Producer
Interface:
xmsRC xmsMsgProducerClose(xmsHMsgProducer *producer,
xmsHErrorBlock errorBlock);
If an application tries to close a message producer that is already closed, the call is
ignored.
Parameters:
producer (input/output)
On input, the handle for the message producer. On output, the
function returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the default delivery mode for messages sent by the message producer.
Parameters:
producer (input)
The handle for the message producer.
deliveryMode (output)
The default delivery mode, which is one of the following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the value is always
XMSC_DELIVERY_NOT_PERSISTENT.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the default priority for messages sent by the message producer.
Parameters:
producer (input)
The handle for the message producer.
priority (output)
The default message priority. The value is an integer in the range
0, the lowest priority, to 9, the highest priority.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the default length of time that a message exists before it expires. The time is
measured from when the message producer sends the message.
Parameters:
producer (input)
The handle for the message producer.
xmsMsgProducerSend – Send
Interface:
xmsRC xmsMsgProducerSend(xmsHMsgProducer producer,
xmsHMsg message,
xmsHErrorBlock errorBlock);
Send a message to the destination that was specified when the message producer
was created. Send the message using the message producer’s default delivery
mode, priority, and time to live.
Parameters:
producer (input)
The handle for the message producer.
message (input)
The handle for the message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_FORMAT_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
Send a message to a specified destination if you are using a message producer for
which no destination was specified when the message producer was created. Send
the message using the message producer’s default delivery mode, priority, and
time to live.
Typically, you specify a destination when you create a message producer but, if
you do not, you must specify a destination every time you send a message.
Parameters:
Send a message to a specified destination if you are using a message producer for
which no destination was specified when the message producer was created. Send
the message using the specified delivery mode, priority, and time to live.
Typically, you specify a destination when you create a message producer but, if
you do not, you must specify a destination every time you send a message.
Parameters:
producer (input)
The handle for the message producer.
destination (input)
The handle for the destination.
message (input)
The handle for the message.
deliveryMode (input)
The delivery mode for the message, which must be one of the
following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the value must be
XMSC_DELIVERY_NOT_PERSISTENT.
priority (input)
The priority of the message. The value can be an integer in the
range 0, for the lowest priority, to 9, for the highest priority. On a
real-time connection to a broker, the value is ignored.
Send a message to the destination that was specified when the message producer
was created. Send the message using the specified delivery mode, priority, and
time to live.
Parameters:
producer (input)
The handle for the message producer.
message (input)
The handle for the message.
deliveryMode (input)
The delivery mode for the message, which must be one of the
following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the value must be
XMSC_DELIVERY_NOT_PERSISTENT.
priority (input)
The priority of the message. The value can be an integer in the
range 0, for the lowest priority, to 9, for the highest priority. On a
real-time connection to a broker, the value is ignored.
timeToLive (input)
The time to live for the message in milliseconds. A value of 0
means that the message never expires. For a real-time connection
to a broker, the value must be 0.
errorBlock (input)
The handle for an error block or a null handle.
Set the default delivery mode for messages sent by the message producer.
Parameters:
producer (input)
The handle for the message producer.
deliveryMode (input)
The default delivery mode, which must be one of the following
values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the value must be
XMSC_DELIVERY_NOT_PERSISTENT.
The default value is XMSC_DELIVERY_PERSISTENT, except for a
real-time connection to a broker for which the default value is
XMSC_DELIVERY_NOT_PERSISTENT.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set the default priority for messages sent by the message producer.
Set the default length of time that a message exists before it expires. The time is
measured from when the message producer sends the message.
Parameters:
producer (input)
The handle for the message producer.
timeToLive (input)
The default time to live in milliseconds. The default value is 0,
which means that a message never expires. For a real-time
connection to a broker, the value must be 0.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
ObjectMessage
An object message is a message whose body comprises a serialized Java or .NET
object.
Functions
xmsObjectMsgGetObjectAsBytes – Get Object as Bytes
Interface:
xmsRC xmsObjectMsgGetObjectAsBytes(xmsHMsg message,
xmsSBYTE *buffer,
xmsINT bufferLength,
xmsINT *actualLength,
xmsHErrorBlock errorBlock);
Get the object that forms the body of the object message.
Notes:
1. If the buffer is not large enough to store the whole object, XMS returns
the object truncated to the length of the buffer, sets the actualLength
parameter to the actual length of the object, and returns an error.
2. If any other error occurs while attempting to get the object, XMS reports
the error but does not set the actualLength parameter.
Set the object that forms the body of the object message.
Parameters:
message (input)
The handle for the message.
value (input)
An array of bytes representing the object to be set.
length (input)
The number of bytes in the array.
errorBlock (input)
The handle for an error block or a null handle.
Property
A Property object represents a property of an object.
If an application sets the property value attribute of a Property object, the property
value replaces any previous value the attribute had.
Functions
xmsPropertyCreate – Create Property (with no property value or
property type)
Interface:
xmsRC xmsPropertyCreate(xmsCHAR *propertyName,
xmsHProperty *property,
xmsHErrorBlock errorBlock);
If an application tries to delete a Property object that is already deleted, the call is
ignored.
Parameters:
property (input/output)
On input, the handle for the Property object. On output the
function returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the byte array property value from the Property object.
For more information about how to use this function, see “C functions that return
a byte array by value” on page 65.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
The buffer to contain the property value, which is an array of
bytes.
Get a pointer to the byte array property value in the Property object.
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
A pointer to the property value, which is an array of bytes.
length (output)
The length of the property value in bytes.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the double precision floating point property value from the Property object.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
The double precision floating point property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the floating point property value from the Property object.
Parameters:
property (input)
The handle for the Property object.
Get the long integer property value from the Property object.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
The long integer property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
property (input)
The handle for the Property object.
propertyName (output)
The buffer to contain the property name.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the property name is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the property name in bytes. If you specify a null
pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the short integer property value from the Property object.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
The short integer property value.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
The buffer to contain the string property value. If data conversion
is required, this is the value after conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the property value is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the property value in bytes. If data conversion is
required, this is the length after conversion. If you specify a null
pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
property (input)
The handle for the Property object.
propertyValue (output)
A pointer to the string property value. If data conversion is
required, this is the value after conversion.
Note that the property value must be a string. The function makes
no attempt to convert a property value with another data type into
a string. If an application calls this function to get a pointer to a
property value that is not a string, XMS returns an error.
length (output)
The length of the property value in bytes. If data conversion is
required, this is the length after conversion.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether the Property object has the specified property type.
Parameters:
property (input)
The handle for the Property object.
propertyType (input)
The property type, which must be one of the following values:
XMS_PROPERTY_TYPE_UNKNOWN
XMS_PROPERTY_TYPE_BOOL
XMS_PROPERTY_TYPE_BYTE
XMS_PROPERTY_TYPE_BYTEARRAY
XMS_PROPERTY_TYPE_CHAR
XMS_PROPERTY_TYPE_STRING
XMS_PROPERTY_TYPE_SHORT
XMS_PROPERTY_TYPE_INT
XMS_PROPERTY_TYPE_LONG
XMS_PROPERTY_TYPE_FLOAT
XMS_PROPERTY_TYPE_DOUBLE
isType (output)
The value is xmsTRUE if the Property object has the specified
property type. The value is xmsFALSE if the Property object does not
have the specified property type.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a boolean property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The boolean property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a byte property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The byte property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a 2-byte character property value in the Property object and set the property
type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The 2-byte character property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a double precision floating point property value in the Property object and set
the property type.
Set a floating point property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The floating point property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set an integer property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The integer property value.
Set a long integer property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The long integer property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a short integer property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The short integer property value.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a string property value in the Property object and set the property type.
Parameters:
property (input)
The handle for the Property object.
propertyValue (input)
The string property value as a character array.
length (input)
The length of the property value in bytes. If the property value is
null terminated with no embedded null characters, you can specify
XMSC_CALCULATE_STRING_SIZE instead and allow XMS to calculate
its length.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
PropertyContext
The PropertyContext class contains functions that get and set properties. These
functions can operate on any object that can have properties.
All objects can have properties except ErrorBlock, Iterator, and Property objects.
Functions
xmsGetBooleanProperty – Get Boolean Property
Interface:
xmsRC xmsGetBooleanProperty(xmsHObj object,
xmsCHAR *propertyName,
xmsBOOL *propertyValue,
xmsHErrorBlock errorBlock);
For more information about how to use this function, see “C functions that return
a byte array by value” on page 65.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (output)
The buffer to contain the value of the property, which is an array
of bytes.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the array of bytes is not returned, but its length is returned
in the actualLength parameter.
actualLength (output)
The number of bytes in the array. If you specify a null pointer on
input, the length of the array is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Determined by the thread context of the object
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get a pointer to the value of the byte array property identified by name.
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (output)
A pointer to the value of the property, which is an array of bytes.
length (output)
The number of bytes in the array.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Determined by the thread context of the object
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the value of the double precision floating point property identified by name.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (output)
The value of the property.
errorBlock (input)
The handle for an error block or a null handle.
Get the value and data type of the property identified by name.
For more information about how to use this function, see “C functions that return
a byte array by value” on page 65.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (output)
The buffer to contain the value of the property, which is returned
as an array of bytes. If the value is a string and data conversion is
required, this is the value after conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the value of the property is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the value of the property in bytes. If the value is a
string and data conversion is required, this is the length after
conversion. If you specify a null pointer on input, the length is not
returned.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (output)
The buffer to contain the value of the property. If data conversion
is required, this is the value after conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the value of the property is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the value of the property in bytes. If data conversion
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (output)
A pointer to the value of the property. If data conversion is
required, this is the value after conversion.
Note that the value of the property must be a string. The function
makes no attempt to convert a value with another data type into a
string. If an application calls this function to get a pointer to a
value that is not a string, XMS returns an error.
length (output)
The length of the value of the property in bytes. If data conversion
is required, this is the length after conversion.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Determined by the thread context of the object
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set the value of the double precision floating point property identified by name.
Parameters:
object (input)
The handle for the object.
propertyName (input)
The name of the property in the format of a null terminated string.
propertyValue (input)
The value of the property.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Determined by the thread context of the object
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
QueueBrowser
An application uses a queue browser to browse messages on a queue without
removing them.
Functions
xmsQueueBrowserClose – Close Queue Browser
Interface:
xmsRC xmsQueueBrowserClose(xmsHQueueBrowser *browser,
xmsHErrorBlock errorBlock);
If an application tries to close a queue browser that is already closed, the call is
ignored.
Parameters:
The function returns an iterator that encapsulates a list of Message objects. The
order of the Message objects in the list is the same as the order in which the
messages would be retrieved from the queue. The application can then use the
iterator to browse each message in turn.
The iterator is updated dynamically as messages are put on the queue and
removed from the queue. Each time the application calls xmsIteratorGetNext() to
browse the next message on the queue, the message returned reflects the current
contents of the queue.
If an application calls this function more than once for a given queue browser, each
call returns a new iterator. The application can therefore use more than one iterator
to browse the messages on a queue and maintain multiple positions within the
queue.
Parameters:
browser (input)
The handle for the queue browser.
iterator (output)
The handle for the iterator.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
browser (input)
The handle for the queue browser.
messageSelector (output)
The buffer to contain the message selector expression. If data
conversion is required, this is the message selector expression after
conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the message selector expression is not returned, but its
length is returned in the actualLength parameter.
actualLength (output)
The length of the message selector expression in bytes. If data
conversion is required, this is the length of the message selector
expression after conversion. If you specify a null pointer on input,
the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Requestor
An application uses a requestor to send a request message and then wait for, and
receive, the reply.
If an application tries to close a requestor that is already closed, the call is ignored.
Note: When an application closes a requestor, the associated session does not close
as well. In this respect, XMS behaves differently compared to JMS.
Parameters:
requestor (input/output)
On input, the handle for the requestor. On output, the function
returns a null handle.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Create a requestor.
Parameters:
session (input)
The handle for a session. The session must not be transacted and
must have one of the following acknowledgement modes:
XMSC_AUTO_ACKNOWLEDGE
XMSC_DUPS_OK_ACKNOWLEDGE
destination (input)
The handle for the destination where the application can send
request messages.
requestor (output)
The handle for the requestor.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
The session associated with the requestor
xmsRequestorRequest – Request
Interface:
xmsRC xmsRequestorRequest(xmsHRequestor requestor,
xmsHMsg requestMessage,
xmsHMsg *replyMessage,
xmsHErrorBlock errorBlock);
Send a request message and then wait for, and receive, a reply from the application
that receives the request message.
A call to this function blocks until a reply is received or until the session ends,
whichever is the sooner.
Parameters:
requestor (input)
The handle for the requestor.
requestMessage (input)
The handle for the request message.
replyMessage (output)
The handle for the reply message.
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
The session associated with the requestor
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Session
A session is a single threaded context for sending and receiving messages.
For a list of the XMS defined properties of a Session, see “Properties of Session” on
page 416.
Functions
xmsSessClose – Close Session
Interface:
xmsRC xmsSessClose(xmsHSess *session,
xmsHErrorBlock errorBlock);
Close the session. If the session is transacted, any transaction in progress is rolled
back.
All objects dependent on the session are deleted. For information about which
objects are deleted, see “Object Deletion” on page 51.
xmsSessCommit – Commit
Interface:
xmsRC xmsSessCommit(xmsHSess session,
xmsHErrorBlock errorBlock);
Create a queue browser for the specified queue using a message selector.
Parameters:
session (input)
The handle for the session.
queue (input)
The handle for a Destination object representing the queue.
messageSelector (input)
A message selector expression as a character array. Only those
messages with properties that match the message selector
expression are delivered to the queue browser.
A value of null or an empty string means that there is no message
selector for the queue browser.
length (input)
The length of the message selector expression in bytes. If the
message selector expression is null terminated with no embedded
null characters, you can specify XMSC_CALCULATE_STRING_SIZE
instead and allow XMS to calculate its length.
browser (output)
The handle for the queue browser.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
v XMS_X_INVALID_SELECTOR_EXCEPTION
Create a message consumer for the specified destination using a message selector.
Create a message consumer for the specified destination using a message selector
and, if the destination is a topic, specifying whether the message consumer
receives the messages published by its own connection.
Parameters:
session (input)
The handle for the session.
destination (input)
The handle for the destination.
messageSelector (input)
A message selector expression as a character array. Only those
messages with properties that match the message selector
expression are delivered to the message consumer.
For more information about durable subscribers, see “Durable subscribers” on page
46.
Parameters:
session (input)
The handle for the session.
topic (input)
The handle for a Destination object representing the topic. The
topic must not be a temporary topic.
subscriptionName (input)
A name that identifies the durable subscription. The name must be
unique within the client identifier for the connection, and is in the
format of a null terminated string.
Create a durable subscriber for the specified topic using a message selector and
specifying whether the durable subscriber receives the messages published by its
own connection.
For more information about durable subscribers, see “Durable subscribers” on page
46.
Parameters:
session (input)
The handle for the session.
topic (input)
The handle for a Destination object representing the topic. The
topic must not be a temporary topic.
subscriptionName (input)
A name that identifies the durable subscription. The name must be
unique within the client identifier for the connection, and is in the
format of a null terminated string.
messageSelector (input)
A message selector expression as a character array. Only those
messages with properties that match the message selector
expression are delivered to the durable subscriber.
A value of null or an empty string means that there is no message
selector for the durable subscriber.
length (input)
The length of the message selector expression in bytes. If the
message selector expression is null terminated with no embedded
null characters, you can specify XMSC_CALCULATE_STRING_SIZE
instead and allow XMS to calculate its length.
Get the acknowledgement mode for the session. The acknowledgement mode is
specified when the session is created.
xmsSessRecover – Recover
Interface:
xmsRC xmsSessRecover(xmsHSess session,
xmsHErrorBlock errorBlock);
Recover the session. Message delivery is stopped and then restarted with the
oldest unacknowledged message.
xmsSessUnsubscribe – Unsubscribe
Interface:
xmsRC xmsSessUnsubscribe(xmsHSess session,
xmsCHAR *subscriptionName,
xmsHErrorBlock errorBlock);
Delete a durable subscription. The messaging server deletes the record of the
durable subscription that it is maintaining and does not send any more messages
to the durable subscriber.
When an application reads a value from the message stream, the value can be
converted by XMS into another data type. For more information about this form of
implicit conversion, see “Stream messages” on page 105.
Functions
xmsStreamMsgReadBoolean – Read Boolean Value
Interface:
xmsRC xmsStreamMsgReadBoolean(xmsHMsg message,
xmsBOOL *value,
xmsHErrorBlock errorBlock);
Get a pointer to an array of bytes in the message stream, and get the length of the
array.
For more information about how to use this function, see “C functions that return
a string or byte array by reference” on page 66.
Parameters:
message (input)
The handle for the message.
array (output)
A pointer to the array of bytes.
length (output)
The number of bytes in the array.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read an 8-byte double precision floating point number from the message stream.
Parameters:
message (input)
The handle for the message.
value (output)
The double precision floating point number that is read. If you
specify a null pointer on input, the call skips over the bytes
without reading them.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
For more information about how to use this function, see “C functions that return
a byte array by value” on page 65.
Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the value, which is returned as an array of
bytes. If the value is a string and data conversion is required, this
is the value after conversion.
If you specify a null pointer on input, the call skips over the value
without reading it.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the value is not returned, but its length is returned in the
actualLength parameter.
actualLength (output)
The length of the value in bytes. If the value is a string and data
conversion is required, this is the length after conversion. If you
specify a null pointer on input, the length is not returned.
objectType (output)
The data type of the value, which is one of the following object
types:
XMS_OBJECT_TYPE_BOOL
XMS_OBJECT_TYPE_BYTE
XMS_OBJECT_TYPE_BYTEARRAY
XMS_OBJECT_TYPE_CHAR
XMS_OBJECT_TYPE_DOUBLE
XMS_OBJECT_TYPE_FLOAT
XMS_OBJECT_TYPE_INT
XMS_OBJECT_TYPE_LONG
XMS_OBJECT_TYPE_SHORT
XMS_OBJECT_TYPE_STRING
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Read a string from the message stream. If required, XMS converts the characters in
the string into the local code page.
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the string that is read. If data conversion is
required, this is the string after conversion.
bufferLength (input)
The length of the buffer in bytes.
If you specify XMSC_QUERY_SIZE, the string is not returned, but its
length is returned in the actualLength parameter, and the cursor is
not advanced.
If you specify XMSC_SKIP, the function skips over the string without
reading it.
actualLength (output)
The length of the string in bytes. If data conversion is required,
this is the length of the string after conversion. If you specify a
null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Notes:
1. If the buffer is not large enough to store the whole string, XMS returns
the string truncated to the length of the buffer, sets the actualLength
parameter to the actual length of the string, and returns an error. XMS
does not advance the internal cursor.
2. If any other error occurs while attempting to read the string, XMS
reports the error but does not set the actualLength parameter or
advance the internal cursor.
xmsStreamMsgReset – Reset
Interface:
xmsRC xmsStreamMsgReset(xmsHMsg message,
xmsHErrorBlock errorBlock);
Put the body of the message into read-only mode and reposition the cursor at the
beginning of the message stream.
Parameters:
message (input)
The handle for the message.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Write a character to the message stream as 2 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The character to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a double precision floating point number to a long integer and write the
long integer to the message stream as 8 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The double precision floating point number to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a floating point number to an integer and write the integer to the message
stream as 4 bytes, high order byte first.
Parameters:
Write an integer to the message stream as 4 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The integer to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a long integer to the message stream as 8 bytes, high order byte first.
Parameters:
message (input)
The handle for the message.
value (input)
The long integer to be written.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Write a short integer to the message stream as 2 bytes, high order byte first.
Parameters:
TextMessage
A text message is a message whose body comprises a string.
Functions
xmsTextMsgGetText – Get Text
Interface:
xmsRC xmsTextMsgGetText(xmsHMsg message,
xmsCHAR *buffer,
xmsINT bufferLength,
xmsINT *actualLength,
xmsHErrorBlock errorBlock);
For more information about how to use this function, see “C functions that return
a string by value” on page 64.
Parameters:
message (input)
The handle for the message.
buffer (output)
The buffer to contain the string. If data conversion is required, this
is the string after conversion.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the string is not returned, but its length is returned in the
actualLength parameter.
actualLength (output)
The length of the string in bytes. If data conversion is required,
this is the length of the string after conversion. If you specify a
null pointer on input, the length is not returned.
errorBlock (input)
The handle for an error block or a null handle.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Notes:
1. If the buffer is not large enough to store the whole string, XMS returns
the string truncated to the length of the buffer, sets the actualLength
parameter to the actual length of the string, and returns an error.
2. If any other error occurs while attempting to get the string, XMS reports
the error but does not set the actualLength parameter.
Set the string that forms the body of the text message.
Parameters:
message (input)
The handle for the message.
value (input)
A character array containing the string to be set.
For information about how to use these functions, see “Coded character set
identifiers” on page 56.
Functions
xmsGetClientCCSID – Get Process CCSID
Interface:
xmsRC xmsGetClientCCSID(xmsINT *ccsid,
xmsHErrorBlock errorBlock);
errorBlock (input)
The handle for an error block or a null handle.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
BytesMessage
A bytes message is a message whose body comprises a stream of bytes.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Message
|
+----xms::BytesMessage
Methods
getBodyLength – Get Body Length
Interface:
xmsLONG getBodyLength() const;
Get the length of the body of the message when the body of the message is
read-only.
Parameters:
None
Returns:
The length of the body of the message in bytes. The method returns the
length of the whole body regardless of where the cursor for reading the
message is currently positioned.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
Read the next byte from the bytes message stream as a signed 8-bit integer.
Parameters:
None
Returns:
The byte that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read an array of bytes from the bytes message stream starting from the current
position of the cursor.
Parameters:
buffer (output)
The buffer to contain the array of bytes that is read. If the number
of bytes remaining to be read from the stream before the call is
greater than or equal to the length of the buffer, the buffer is filled.
Otherwise, the buffer is partially filled with all the remaining
bytes.
Read the next 2 bytes from the bytes message stream as a character.
Parameters:
None
Returns:
The character that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 8 bytes from the bytes message stream as a double precision floating
point number.
Read the next 4 bytes from the bytes message stream as a floating point number.
Parameters:
None
Returns:
The floating point number that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 4 bytes from the bytes message stream as a signed 32-bit integer.
Parameters:
None
Returns:
The integer that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 8 bytes from the bytes message stream as a signed 64-bit integer.
Read the next 2 bytes from the bytes message stream as a signed 16-bit integer.
Parameters:
None
Returns:
The short integer that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next byte from the bytes message stream as an unsigned 8-bit integer.
Parameters:
None
Returns:
The byte that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read the next 2 bytes from the bytes message stream as an unsigned 16-bit integer.
Read a string, encoded in UTF-8, from the bytes message stream. If required, XMS
converts the characters in the string from UTF-8 into the local code page.
Parameters:
None
Returns:
A String object encapsulating the string that is read. If data conversion is
required, this is the string after conversion.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
reset – Reset
Interface:
xmsVOID reset() const;
Put the body of the message into read-only mode and reposition the cursor at the
beginning of the bytes message stream.
Parameters:
None
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
Write a character to the bytes message stream as 2 bytes, high order byte first.
Parameters:
value (input)
The character to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a double precision floating point number to a long integer and write the
long integer to the bytes message stream as 8 bytes, high order byte first.
Parameters:
value (input)
The double precision floating point number to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a floating point number to an integer and write the integer to the bytes
message stream as 4 bytes, high order byte first.
Parameters:
value (input)
The floating point number to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write an integer to the bytes message stream as 4 bytes, high order byte first.
Parameters:
value (input)
The integer to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a long integer to the bytes message stream as 8 bytes, high order byte first.
Parameters:
value (input)
The long integer to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a short integer to the bytes message stream as 2 bytes, high order byte first.
Parameters:
value (input)
The short integer to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a string, encoded in UTF-8, to the bytes message stream. If required, XMS
converts the characters in the string from the local code page into UTF-8.
Parameters:
value (input)
A String object encapsulating the string to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Inherited methods
The following methods are inherited from the Message class:
clearBody, clearProperties, getHandle,
getJMSCorrelationID,getJMSDeliveryMode, getJMSDestination,
getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered,
getJMSReplyTo, getJMSTimestamp, getJMSType, getProperties, isNull,
propertyExists, setJMSCorrelationID, setJMSDeliveryMode, setJMSDestination,
setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered,
setJMSReplyTo, setJMSTimestamp, setJMSType
Connection
A Connection object represents an application’s active connection to a broker.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Connection
For a list of the XMS defined properties of a Connection object, see “Properties of
Connection” on page 403.
Create a session.
Parameters:
transacted (input)
The value xmsTRUE means that the session is transacted. The value
xmsFALSE means that the session is not transacted.
For a real-time connection to a broker, the value must be xmsFALSE.
acknowledgeMode (input)
Indicates how messages received by an application are
acknowledged. The value must be one of the following
acknowledgement modes:
XMSC_AUTO_ACKNOWLEDGE
XMSC_CLIENT_ACKNOWLEDGE
XMSC_DUPS_OK_ACKNOWLEDGE
For a real-time connection to a broker, the value must be
XMSC_AUTO_ACKNOWLEDGE or XMSC_DUPS_OK_ACKNOWLEDGE
Get a pointer to the exception listener that is registered with the connection.
For more information about using exception listeners, see “Exception listeners in
C++” on page 80.
Parameters:
None
Returns:
A pointer to the exception listener. If no exception listener is registered
with the connection, the method returns a null pointer.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the handle that a C application would use to access the connection.
Parameters:
None
Returns:
The handle for the connection.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a client identifier for the connection. A client identifier is used only to support
durable subscriptions in the publish/subscribe domain, and is ignored in the
point-to-point domain.
If an application calls this method to set a client identifier for a connection, the
application must do so immediately after creating the connection, and before
performing any other operation on the connection. If the application tries to call
the method after this point, the call throws exception
XMS_X_ILLEGAL_STATE_EXCEPTION.
For more information about using exception listeners, see “Exception listeners in
C++” on page 80.
Parameters:
lsr (input)
A pointer to the exception listener.
If an exception listener is already registered with the connection,
you can cancel the registration by specifying a null pointer instead.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Start, or restart, the delivery of incoming messages for the connection. The call is
ignored if the connection is already started.
Parameters:
None
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Stop the delivery of incoming messages for the connection. The call is ignored if
the connection is already stopped.
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
ConnectionFactory
An application uses a connection factory to create a connection.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::ConnectionFactory
Constructors
ConnectionFactory – Create Connection Factory
Interface:
ConnectionFactory();
Methods
~ConnectionFactory – Delete Connection Factory
Interface:
virtual ~ConnectionFactory();
If an application tries to delete a connection factory that is already deleted, the call
is ignored.
The connection is created in stopped mode. No messages are delivered until the
application calls Connection.start().
Parameters:
None
Returns:
The Connection object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_SECURITY_EXCEPTION
The specified user identifier and password are used to authenticate the application.
The connection factory properties XMSC_USERID and XMSC_PASSWORD, if they
are set, are ignored. The user identifier and password are ignored if the application
connects to a WebSphere MQ queue manager in bindings mode.
The connection is created in stopped mode. No messages are delivered until the
application calls Connection.start().
Parameters:
userID (input)
A String object encapsulating the user identifier to be used to
Get the handle that a C application would use to access the connection factory.
Parameters:
None
Returns:
The handle for the connection factory.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
ConnectionMetaData
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::ConnectionMetaData
Methods
getHandle – Get Handle
Interface:
xmsHConnMetaData getHandle() const;
Get the handle that a C application would use to access the connection metadata.
Parameters:
None
Returns:
The handle for the connection metadata.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get a list of the names of the JMS defined message properties supported by the
connection.
The method returns an iterator that encapsulates a list of Property objects, where
each Property object encapsulates the name of a JMS defined message property.
The application can then use the iterator to retrieve the name of each JMS defined
message property in turn.
Note: The equivalent JMS method performs a slightly different function. The JMS
method returns an enumeration of the names of the JMS defined message
properties.
Parameters:
None
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
Destination
A destination is where an application sends messages, or it is a source from which
an application receives messages, or both.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Destination
For a list of the XMS defined properties of a Destination object, see “Properties of
Destination” on page 409.
Constructors
Destination – Create Destination (specifying a type and name)
Interface:
Destination(const xmsDESTINATION_TYPE destinationType,
const String & destinationName);
For a destination that is a queue, this constructor does not create the queue in the
messaging server. You must create the queue before an application can call this
constructor.
Parameters:
URI (input)
A String object encapsulating the URI.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Methods
~Destination – Delete Destination
Interface:
virtual ~Destination();
For a destination that is a queue, this method does not delete the queue in the
messaging server unless the queue was created for an XMS temporary queue.
Get the handle that a C application would use to access the destination.
Parameters:
None
Returns:
The handle for the destination.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the name of the destination in the format of a uniform resource identifier
(URI).
Parameters:
None
Returns:
A String object encapsulating the URI. The URI is either a queue URI or a
topic URI.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
There are different types of XMS exception, and an Exception object is just one
type of exception. However, the Exception class is a superclass of the other XMS
exception classes. XMS throws an Exception object in situations where none of the
other types of exception are appropriate.
Methods
~Exception – Delete Exception
Interface:
virtual ~Exception() throw();
Dump the exception to the specified C++ output stream as formatted text.
Parameters:
outputStream (input)
The C++ output stream.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the free format data that provides additional information about the error.
Parameters:
None
Returns:
A String object encapsulating the error data.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the string of characters that describes the error. The characters in the string are
the same as those in the named constant that represents the error code.
Parameters:
None
Returns:
A String object encapsulating the error string.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the handle for the internal error block that XMS creates for the exception.
Parameters:
None
Returns:
The handle for the error block.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
ExceptionListener
An application uses an exception listener to be notified asynchronously of a
problem with a connection.
Inheritance hierarchy:
None
Methods
onException – On Exception
Interface:
virtual xmsVOID onException(Exception *exception);
For more information about using exception listeners, see “Exception listeners in
C++” on page 80.
Parameters:
exception (input)
A pointer to an exception created by XMS.
Returns:
Void
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
InitialContext
An application uses an InitialContext object to create objects from object definitions
that are retrieved from a repository of administered objects.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::InitialContext
For a list of the XMS defined properties of an InitialContext object, see “Properties
of InitialContext” on page 410.
Constructors
InitialContext – Create Initial Context
Interface:
InitialContext( const String & uri);
InitialContext & create( const String & uri);
Note: The creation of the InitialContext object is done separately from the
connection to the repository containing administered objects. This allows
properties to be set on the InitialContext object prior to connection. For
further details, see “InitialContext properties” on page 86.
Parameters:
uri (input)
A String object encapsulating a URI that identifies the name and
location of a repository containing administered objects. The exact
syntax of the URI depends on the context type. For further
information, see “URI format for XMS initial contexts” on page 87.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Delete the InitialContext object. This frees all resources associated with the
InitialContext object.
Get the handle that a C application would use to access the InitialContext object.
Parameters:
None
Returns:
The handle for the InitialContext object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Create an object from an object definition that is retrieved from the repository of
administered objects.
Parameters:
objectName (input)
A String object encapsulating the name of the administered object.
The name can be either a simple name or a complex name. For
further details, see “Retrieval of administered objects” on page 89.
Returns:
A pointer to the object that is created.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
InvalidClientIDException
XMS throws this exception if an application attempts to set a client identifier for a
connection, but the client identifier is not valid or is already in use.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::InvalidClientIDException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
InvalidDestinationException
XMS throws this exception if an application specifies a destination that is not valid.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::InvalidDestinationException
InvalidSelectorException
XMS throws this exception if an application provides a message selector expression
whose syntax is not valid.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::InvalidSelectorException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
Iterator
An iterator encapsulates a list of objects. An application uses an iterator to access
object in turn.
Inheritance hierarchy:
None
An iterator also encapsulates a cursor that maintains the current position in the
list. When an iterator is created, the position of the cursor is before the first object.
Methods
~Iterator – Delete Iterator
Interface:
virtual ~Iterator();
Get the handle that a C application would use to access the iterator.
Parameters:
None
Returns:
The handle for the iterator.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Move the cursor to the next object and get the object at the new position of the
cursor.
Parameters:
None
Returns:
A pointer to the object.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether there are any more objects beyond the current position of the
cursor. The call does not move the cursor.
Parameters:
None
MapMessage
A map message is a message whose body comprises a set of name-value pairs,
where each value has an associated data type.
Inheritance hierarchy:
When an application gets the value of name-value pair, the value can be converted
by XMS into another data type. For more information about this form of implicit
conversion, see “Map messages” on page 104.
Methods
getBoolean – Get Boolean Value
Interface:
xmsBOOL getBoolean(const String & name) const;
Get the boolean value identified by name from the body of the map message.
Parameters:
name (input)
A String object encapsulating the name that identifies the boolean
value.
Returns:
The boolean value retrieved from the body of the map message.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the byte identified by name from the body of the map message.
Parameters:
name (input)
A String object encapsulating the name that identifies the byte.
Returns:
The byte retrieved from the body of the map message. No data conversion
is performed on the byte.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
name (input)
A String object encapsulating the name that identifies the array of
bytes.
buffer (output)
The buffer to contain the array of bytes. No data conversion is
performed on the bytes that are returned.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the array of bytes is not returned, but its length is returned
in the actualLength parameter.
actualLength (output)
The number of bytes in the array. If you specify a null pointer on
input, the length of the array is not returned.
Returns:
The number of bytes in the array.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the character identified by name from the body of the map message.
Parameters:
name (input)
A String object encapsulating the name that identifies the character.
Returns:
The character retrieved from the body of the map message.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the double precision floating point number identified by name from the body
of the map message.
Parameters:
Get the floating point number identified by name from the body of the map
message.
Parameters:
name (input)
A String object encapsulating the name that identifies the floating
point number.
Returns:
The floating point number retrieved from the body of the map message.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the integer identified by name from the body of the map message.
Parameters:
name (input)
A String object encapsulating the name that identifies the integer.
Returns:
The integer retrieved from the body of the map message.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the long integer identified by name from the body of the map message.
Get a list of the name-value pairs in the body of the map message.
The method returns an iterator that encapsulates a list of Property objects, where
each Property object encapsulates a name-value pair. The application can then use
the iterator to access each name-value pair in turn.
Note: The equivalent JMS method performs a slightly different function. The JMS
method returns an enumeration of only the names, not the values, in the
body of the map message.
Parameters:
None
Returns:
The Iterator object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the value of a name-value pair, and its data type, from the body of the map
message. The name-value pair is identified by name.
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
name (input)
A String object encapsulating the name of the name-value pair.
Get the short integer identified by name from the body of the map message.
Parameters:
name (input)
A String object encapsulating the name that identifies the short
integer.
Returns:
The short integer retrieved from the body of the map message.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether the body of the map message contains a name-value pair with the
specified name.
Parameters:
name (input)
A String object encapsulating the name of the name-value pair.
Returns:
v xmsTRUE, if the body of the map message contains a name-value pair
with the specified name.
v xmsFALSE, if the body of the map message does not contain a name-value
pair with the specified name.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a double precision floating point number in the body of the map message.
Parameters:
name (input)
A String object encapsulating the name to identify the double
precision floating point number in the body of the map message.
value (input)
The double precision floating point number to be set.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a value, with a specified data type, in the body of the map message.
Parameters:
Inherited methods
The following methods are inherited from the Message class:
clearBody, clearProperties, getHandle,
getJMSCorrelationID,getJMSDeliveryMode, getJMSDestination,
getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered,
getJMSReplyTo, getJMSTimestamp, getJMSType, getProperties, isNull,
propertyExists, setJMSCorrelationID, setJMSDeliveryMode, setJMSDestination,
setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered,
setJMSReplyTo, setJMSTimestamp, setJMSType
Message
A Message object represents a message that an application sends or receives.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Message
For a list of the JMS message header fields in a Message object, see “Header fields
in an XMS message” on page 97. For a list of the JMS defined properties of a
Message object, see “JMS-defined properties of a message” on page 99. For a list of
the IBM defined properties of a Message object, see “IBM-defined properties of a
message” on page 100.
acknowledge – Acknowledge
Interface:
xmsVOID acknowledge();
An application can call this method if the acknowledgement mode of the session is
XMSC_CLIENT_ACKNOWLEDGE. Calls to the method are ignored if the session
has any other acknowledgement mode or is transacted.
Messages that have been received but not acknowledged might be re-delivered.
Clear the body of the message. The header fields and message properties are not
cleared.
If an application clears a message body, the body is left in the same state as an
empty body in a newly created message. The state of an empty body in a newly
An application can clear a message body at any time, no matter what state the
body is in. If a message body is read-only, the only way that an application can
write to the body is for the application to clear the body first.
Parameters:
None
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Clear the properties of the message. The header fields and the message body are
not cleared.
An application can clear the properties of a message at any time, no matter what
state the properties are in. If the properties of a message are read-only, the only
way that the properties can become writable is for the application to clear the
properties first.
Parameters:
None
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the handle that a C application would use to access the message.
Parameters:
None
Returns:
The handle for the message.
Thread context:
Any
Exceptions:
Get the delivery mode of the message. The delivery mode is set by the
MessageProducer.send() call when the message is sent.
Parameters:
None
Returns:
The delivery mode of the message, which is one of the following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a newly created message that has not been sent, the delivery mode is
XMSC_DELIVERY_PERSISTENT, except for a real-time connection to a broker for
which the delivery mode is XMSC_DELIVERY_NOT_PERSISTENT. For a message
that has been received, the method returns the delivery mode that was set
by the MessageProducer.send() call when the message was sent unless the
receiving application changes the delivery mode by calling
setJMSDeliveryMode().
Exceptions:
v XMS_X_GENERAL_EXCEPTION
The expiration time is set by the MessageProducer.send() call when the message is
sent. Its value is calculated by adding the time to live, as specified by the sending
application, to the time when the message is sent. The expiration time is expressed
in milliseconds since 00:00:00 GMT on the 1 January 1970.
If the time to live is 0, the MessageProducer.send() call sets the expiration time to 0
to indicate that the message does not expire.
XMS discards expired messages and does not deliver them to applications.
Parameters:
None
Returns:
The expiration time of the message.
For a newly created message that has not been sent, the expiration time is
0 unless the sending application sets a different expiration time by calling
setJMSExpiration(). For a message that has been received, the method
returns the expiration time that was set by the MessageProducer.send() call
when the message was sent unless the receiving application changes the
expiration time by calling setJMSExpiration().
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the message identifier of the message. The message identifier is set by the
MessageProducer.send() call when the message is sent.
Notes:
1. If a message has no message identifier, the method throws an exception.
Get the priority of the message. The priority is set by the MessageProducer.send()
call when the message is sent.
Parameters:
None
Returns:
The priority of the message. The value is an integer in the range 0, the
lowest priority, to 9, the highest priority.
For a newly created message that has not been sent, the priority is 4 unless
the sending application sets a different priority by calling setJMSPriority().
For a message that has been received, the method returns the priority that
was set by the MessageProducer.send() call when the message was sent
unless the receiving application changes the priority by calling
setJMSPriority().
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the time when the message was sent. The time stamp is set by the
MessageProducer.send() call when the message is sent and is expressed in
milliseconds since 00:00:00 GMT on the 1 January 1970.
Parameters:
None
Returns:
The time when the message was sent.
For a newly created message that has not been sent, the time stamp is 0
unless the sending application sets a different time stamp by calling
setJMSTimestamp(). For a message that has been received, the method
returns the time stamp that was set by the MessageProducer.send() call
when the message was sent unless the receiving application changes the
time stamp by calling setJMSTimestamp().
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Notes:
1. If the time stamp is undefined, the method returns 0 but throws no
exception.
The method returns an iterator that encapsulates a list of Property objects. The
application can then use the iterator to access each property in turn.
Note: The equivalent JMS method performs a slightly different function. The JMS
method returns an enumeration of only the names of the properties of the
message, not their values.
Parameters:
None
Returns:
The Iterator object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether the message has a property with the specified name.
Parameters:
propertyName (input)
A String object encapsulating the name of the property.
Returns:
v xmsTRUE, if the message has a property with the specified name.
v xmsFALSE, if the message does not have a property with the specified
name.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A delivery mode set by this method before the message is sent is ignored and
replaced by the MessageProducer.send() call when the message is sent. However,
you can use this method to change the delivery mode of a message that has been
received.
Parameters:
deliveryMode (input)
The delivery mode of the message, which must be one of the
following values:
A destination set by this method before the message is sent is ignored and replaced
by the MessageProducer.send() call when the message is sent. However, you can
use this method to change the destination of a message that has been received.
Parameters:
destination (input)
A Destination object representing the destination of the message.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
An expiration time set by this method before the message is sent is ignored and
replaced by the MessageProducer.send() call when the message is sent. However,
you can use this method to change the expiration time of a message that has been
received.
Parameters:
expiration (input)
The expiration time of the message expressed in milliseconds since
00:00:00 GMT on the 1 January 1970.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A message identifier set by this method before the message is sent is ignored and
replaced by the MessageProducer.send() call when the message is sent. However,
you can use this method to change the message identifier of a message that has
been received.
Parameters:
msgID (input)
A String object encapsulating the message identifier.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A priority set by this method before the message is sent is ignored and replaced by
the MessageProducer.send() call when the message is sent. However, you can use
this method to change the priority of a message that has been received.
Parameters:
priority (input)
The priority of the message. The value can be an integer in the
range 0, the lowest priority, to 9, the highest priority.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
A time stamp set by this method before the message is sent is ignored and
replaced by the MessageProducer.send() call when the message is sent. However,
you can use this method to change the time stamp of a message that has been
received.
Parameters:
timeStamp (input)
The time when the message is sent expressed in milliseconds since
00:00:00 GMT on the 1 January 1970.
Returns:
Void
Exceptions:
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
MessageConsumer
An application uses a message consumer to receive messages sent to a destination.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::MessageConsumer
Methods
close – Close Message Consumer
Interface:
xmsVOID close();
If an application tries to close a message consumer that is already closed, the call is
ignored.
Parameters:
None
Get the handle that a C application would use to access the message consumer.
Parameters:
None
Returns:
The handle for the message consumer.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get a pointer to the message listener that is registered with the message consumer.
For more information about using message listeners, see “Message listeners in
C++” on page 78.
Parameters:
None
Returns:
A pointer to the message listener. If no message listener is registered with
the message consumer, the method returns a null pointer.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
receive – Receive
Interface:
Message * receive() const;
Receive the next message for the message consumer. The call waits indefinitely for
a message, or until the message consumer is closed.
Parameters:
None
Returns:
A pointer to the Message object. If the message consumer is closed while
the call is waiting for a message, the method returns a pointer to a null
Message object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Receive the next message for the message consumer if one is available
immediately.
Parameters:
None
Returns:
A pointer to a Message object. If no message is available immediately, the
method returns a pointer to a null Message object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For more information about using message listeners, see “Message listeners in
C++” on page 78.
Parameters:
lsr (input)
A pointer to the message listener. If a message listener is already
registered with the message consumer, you can cancel the
registration by specifying a null pointer instead.
Returns:
Void
Exceptions:
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
MessageEOFException
XMS throws this exception if XMS encounters the end of a bytes message stream
when an application is reading the body of a bytes message.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::MessageEOFException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
MessageFormatException
XMS throws this exception if XMS encounters a message with a format that is not
valid.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::MessageFormatException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
MessageListener
An application uses a message listener to receive messages asynchronously.
Inheritance hierarchy:
None
For more information about using message listeners, see “Message listeners in
C++” on page 78.
Parameters:
message (input)
A pointer to the Message object.
Returns:
Void
MessageNotReadableException
XMS throws this exception if an application attempts to read the body of a
message that is write-only.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::MessageNotReadableException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
MessageNotWritableException
XMS throws this exception if an application attempts to write to the body of a
message that is read-only.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::MessageNotWritableException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
Methods
close – Close Message Producer
Interface:
xmsVOID close();
If an application tries to close a message producer that is already closed, the call is
ignored.
Parameters:
None
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the default delivery mode for messages sent by the message producer.
Parameters:
None
Returns:
The default delivery mode, which is one of the following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the method always returns
XMSC_DELIVERY_NOT_PERSISTENT.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the handle that a C application would use to access the message producer.
Parameters:
None
Returns:
The handle for the message producer.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the default priority for messages sent by the message producer.
Parameters:
None
Returns:
The default message priority. The value is an integer in the range 0, the
lowest priority, to 9, the highest priority.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the default length of time that a message exists before it expires. The time is
measured from when the message producer sends the message.
Parameters:
None
Returns:
The default time to live in milliseconds. A value of 0 means that a message
never expires.
For a real-time connection to a broker, the method always returns 0.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
send – Send
Interface:
xmsVOID send(const Message & message) const;
Send a message to the destination that was specified when the message producer
was created. Send the message using the message producer’s default delivery
mode, priority, and time to live.
Parameters:
message (input)
The Message object.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_FORMAT_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
Send a message to the destination that was specified when the message producer
was created. Send the message using the specified delivery mode, priority, and
time to live.
Send a message to a specified destination if you are using a message producer for
which no destination was specified when the message producer was created. Send
the message using the message producer’s default delivery mode, priority, and
time to live.
Typically, you specify a destination when you create a message producer but, if
you do not, you must specify a destination every time you send a message.
Parameters:
destination (input)
The Destination object.
message (input)
The Message object.
Returns:
Void
Exceptions:
Send a message to a specified destination if you are using a message producer for
which no destination was specified when the message producer was created. Send
the message using the specified delivery mode, priority, and time to live.
Typically, you specify a destination when you create a message producer but, if
you do not, you must specify a destination every time you send a message.
Parameters:
destination (input)
The Destination object.
message (input)
The Message object.
deliveryMode (input)
The delivery mode for the message, which must be one of the
following values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the value must be
XMSC_DELIVERY_NOT_PERSISTENT.
priority (input)
The priority of the message. The value can be an integer in the
range 0, for the lowest priority, to 9, for the highest priority. On a
real-time connection to a broker, the value is ignored.
timeToLive (input)
The time to live for the message in milliseconds. A value of 0
means that the message never expires. For a real-time connection
to a broker, the value must be 0.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_FORMAT_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
v XMS_X_ILLEGAL_STATE_EXCEPTION
Set the default delivery mode for messages sent by the message producer.
Parameters:
deliveryMode (input)
The default delivery mode, which must be one of the following
values:
XMSC_DELIVERY_PERSISTENT
XMSC_DELIVERY_NOT_PERSISTENT
For a real-time connection to a broker, the value must be
XMSC_DELIVERY_NOT_PERSISTENT.
The default value is XMSC_DELIVERY_PERSISTENT, except for a
real-time connection to a broker for which the default value is
XMSC_DELIVERY_NOT_PERSISTENT.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set the default priority for messages sent by the message producer.
Set the default length of time that a message exists before it expires. The time is
measured from when the message producer sends the message.
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
ObjectMessage
An object message is a message whose body comprises a serialized Java or .NET
object.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Message
|
+----xms::ObjectMessage
Methods
getObject – Get Object as Bytes
Interface:
xmsINT getObject(xmsSBYTE *buffer,
xmsINT bufferLength,
xmsINT *actualLength);
Get the object that forms the body of the object message.
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
buffer (output)
The buffer to contain the object, which is returned as an array of
bytes.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the object is not returned, but its length is returned in the
actualLength parameter.
Notes:
1. If the buffer is not large enough to store the whole object, XMS returns
the object truncated to the length of the buffer, sets the actualLength
parameter to the actual length of the object, and returns an error.
2. If any other error occurs while attempting to get the object, XMS reports
the error but does not set the actualLength parameter.
Set the string that forms the body of the object message.
Parameters:
value (input)
An array of bytes representing the object to be set.
length (input)
The number of bytes in the array.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Inherited methods
The following methods are inherited from the Message class:
clearBody, clearProperties, getHandle,
getJMSCorrelationID,getJMSDeliveryMode, getJMSDestination,
getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered,
getJMSReplyTo, getJMSTimestamp, getJMSType, getProperties, isNull,
propertyExists, setJMSCorrelationID, setJMSDeliveryMode, setJMSDestination,
setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered,
setJMSReplyTo, setJMSTimestamp, setJMSType
Property
A Property object represents a property of an object.
Inheritance hierarchy:
None
If an application sets the property value attribute of a Property object, the property
value replaces any previous value the attribute had.
Constructors
Property – Copy Property
Interface:
Property(const Property & property);
Create a Property object with a property name, a property value, and a property
type.
Parameters:
propertyName (input)
A String object encapsulating the property name.
propertyValue (input)
The property value. The property type is determined by the data
type of the property value.
length (input)
The length of the property value in bytes. This parameter is
applicable only if the property value is an array of bytes.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Methods
~Property – Delete Property
Interface:
virtual ~Property();
If an application tries to delete a Property object that is already deleted, the call is
ignored.
Parameters:
None
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the byte array property value from the Property object.
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
propertyValue (output)
The buffer to contain the property value, which is an array of
bytes.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the property value is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the property value in bytes. If you specify a null
pointer on input, the length is not returned.
Returns:
The length of the property value in bytes.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the 2-byte character property value from the Property object.
Parameters:
None
Returns:
The 2-byte character property value.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the double precision floating point property value from the Property object.
Parameters:
None
Returns:
The double precision floating point property value.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the floating point property value from the Property object.
Parameters:
None
Returns:
The floating point property value.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the handle that a C application would use to access the Property object.
Parameters:
None
Returns:
The handle for the Property object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the long integer property value from the Property object.
Parameters:
None
Returns:
The long integer property value.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the short integer property value from the Property object.
Parameters:
None
Returns:
The short integer property value.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Check whether the Property object has the specified property type.
Parameters:
propertyType (input)
The property type, which must be one of the following values:
XMS_PROPERTY_TYPE_UNKNOWN
XMS_PROPERTY_TYPE_BOOL
XMS_PROPERTY_TYPE_BYTE
XMS_PROPERTY_TYPE_BYTEARRAY
XMS_PROPERTY_TYPE_CHAR
XMS_PROPERTY_TYPE_STRING
XMS_PROPERTY_TYPE_SHORT
XMS_PROPERTY_TYPE_INT
XMS_PROPERTY_TYPE_LONG
XMS_PROPERTY_TYPE_FLOAT
XMS_PROPERTY_TYPE_DOUBLE
Returns:
v xmsTRUE, if the Property object has the specified property type.
v xmsFALSE, if the Property object does not have the specified property
type.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a boolean property value in the Property object and set the property type.
Parameters:
propertyValue (input)
The boolean property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a byte property value in the Property object and set the property type.
Parameters:
propertyValue (input)
The byte property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a byte array property value in the Property object and set the property type.
Parameters:
propertyValue (input)
The property value, which is an array of bytes.
length (input)
The length of the property value in bytes.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a 2-byte character property value in the Property object and set the property
type.
Parameters:
propertyValue (input)
The 2-byte character property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a double precision floating point property value in the Property object and set
the property type.
Parameters:
propertyValue (input)
The double precision floating point property value.
Set a floating point property value in the Property object and set the property type.
Parameters:
propertyValue (input)
The floating point property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set an integer property value in the Property object and set the property type.
Parameters:
propertyValue (input)
The integer property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a long integer property value in the Property object and set the property type.
Set a short integer property value in the Property object and set the property type.
Parameters:
propertyValue (input)
The short integer property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Set a string property value in the Property object and set the property type.
Parameters:
propertyValue (input)
A String object encapsulating the string property value.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Methods
getBooleanProperty – Get Boolean Property
Interface:
xmsBOOL getBooleanProperty(const String & propertyName) const;
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
propertyName (input)
A String object encapsulating the name of the property.
propertyValue (output)
The buffer to contain the value of the property, which is an array
of bytes.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the array of bytes is not returned, but its length is returned
in the actualLength parameter.
actualLength (output)
The number of bytes in the array. If you specify a null pointer on
input, the length of the array is not returned.
Returns:
The number of bytes in the array.
Thread context:
Determined by the subclass
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the value and data type of the property identified by name.
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
propertyName (input)
A String object encapsulating the name of the property.
propertyValue (output)
The buffer to contain the value of the property, which is returned
as an array of bytes. If the value is a string and data conversion is
required, this is the value after conversion.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the value of the property is not returned, but its length is
returned in the actualLength parameter.
actualLength (output)
The length of the value of the property in bytes. If the value is a
string and data conversion is required, this is the length after
conversion. If you specify a null pointer on input, the length is not
returned.
Returns:
The data type of the value of the property, which is one of the following
object types:
XMS_OBJECT_TYPE_BOOL
XMS_OBJECT_TYPE_BYTE
Set the value of the double precision floating point property identified by name.
Parameters:
propertyName (input)
A String object encapsulating the name of the property.
propertyValue (input)
The value of the property.
Returns:
Void
Thread context:
Determined by the subclass
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
QueueBrowser
An application uses a queue browser to browse messages on a queue without
removing them.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::QueueBrowser
Methods
close – Close Queue Browser
Interface:
xmsVOID close();
If an application tries to close a queue browser that is already closed, the call is
ignored.
Parameters:
None
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
The method returns an iterator that encapsulates a list of Message objects. The
order of the Message objects in the list is the same as the order in which the
messages would be retrieved from the queue. The application can then use the
iterator to browse each message in turn.
The iterator is updated dynamically as messages are put on the queue and
removed from the queue. Each time the application calls Iterator.getNext() to
browse the next message on the queue, the message returned reflects the current
contents of the queue.
If an application calls this method more than once for a given queue browser, each
call returns a new iterator. The application can therefore use more than one iterator
to browse the messages on a queue and maintain multiple positions within the
queue.
Parameters:
None
Get the handle that a C application would use to access the queue browser.
Parameters:
None
Returns:
The handle for the queue browser.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
Requestor
An application uses a requestor to send a request message and then wait for, and
receive, the reply.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Requestor
Constructors
Requestor – Create Requestor
Interface:
Requestor(const Session & session,
const Destination & destination);
Create a requestor.
Parameters:
Methods
close – Close Requestor
Interface:
xmsVOID close();
If an application tries to close a requestor that is already closed, the call is ignored.
Note: When an application closes a requestor, the associated session does not close
as well. In this respect, XMS behaves differently compared to JMS.
Parameters:
None
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the handle that a C application would use to access the requestor.
Parameters:
None
Returns:
The handle for the requestor.
Thread context:
Any
Exceptions:
request – Request
Interface:
Message * request(const Message & requestMessage) const;
Send a request message and then wait for, and receive, a reply from the application
that receives the request message.
A call to this method blocks until a reply is received or until the session ends,
whichever is the sooner.
Parameters:
requestMessage (input)
The Message object encapsulating the request message.
Returns:
A pointer to the Message object encapsulating the reply message.
Thread context:
The session associated with the requestor
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
SecurityException
XMS throws this exception if the user identifer and password provided to
authenticate an application are rejected. XMS also throws this exception if an
authority check fails and prevents a method from completing.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::SecurityException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
Session
A session is a single threaded context for sending and receiving messages.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Session
For a list of the XMS defined properties of a Session object, see “Properties of
Session” on page 416.
Methods
close – Close Session
Interface:
xmsVOID close();
All objects dependent on the session are deleted. For information about which
objects are deleted, see “Object Deletion” on page 51.
If an application tries to close a session that is already closed, the call is ignored.
Parameters:
None
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
commit – Commit
Interface:
xmsVOID commit();
Create a queue browser for the specified queue using a message selector.
Parameters:
queue (input)
A Destination object representing the queue.
messageSelector (input)
A String object encapsulating a message selector expression. Only
those messages with properties that match the message selector
expression are delivered to the queue browser.
A null String object means that there is no message selector for the
queue browser.
Returns:
The QueueBrowser object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
v XMS_X_INVALID_SELECTOR_EXCEPTION
Create a message consumer for the specified destination using a message selector.
Parameters:
destination (input)
The Destination object.
messageSelector (input)
A String object encapsulating a message selector expression. Only
those messages with properties that match the message selector
expression are delivered to the message consumer.
A null String object means that there is no message selector for the
message consumer.
Returns:
The MessageConsumer object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
v XMS_X_INVALID_SELECTOR_EXCEPTION
Create a message consumer for the specified destination using a message selector
and, if the destination is a topic, specifying whether the message consumer
receives the messages published by its own connection.
Parameters:
destination (input)
The Destination object.
messageSelector (input)
A String object encapsulating a message selector expression. Only
For more information about durable subscribers, see “Durable subscribers” on page
46.
Parameters:
topic (input)
A Destination object representing the topic. The topic must not be a
temporary topic.
subscriptionName (input)
A String object encapsulating a name that identifies the durable
subscription. The name must be unique within the client identifier
for the connection.
Returns:
The MessageConsumer object representing the durable subscriber.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
Create a durable subscriber for the specified topic using a message selector and
specifying whether the durable subscriber receives the messages published by its
own connection.
For more information about durable subscribers, see “Durable subscribers” on page
46.
Parameters:
topic (input)
A Destination object representing the topic. The topic must not be a
temporary topic.
subscriptionName (input)
A String object encapsulating a name that identifies the durable
subscription. The name must be unique within the client identifier
for the connection.
messageSelector (input)
A String object encapsulating a message selector expression. Only
those messages with properties that match the message selector
expression are delivered to the durable subscriber.
A null String object means that there is no message selector for the
durable subscriber.
noLocal (input)
The value xmsTRUE means that the durable subscriber does not
receive the messages published by its own connection. The value
xmsFALSE means that the durable subscriber does receive the
messages published by its own connection. The default value is
xmsFALSE.
Returns:
The MessageConsumer object representing the durable subscriber.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_INVALID_DESTINATION_EXCEPTION
v XMS_X_INVALID_SELECTOR_EXCEPTION
This method does not create the queue in the messaging server. You must create
the queue before an application can call this method.
Parameters:
queueName (input)
A String object encapsulating the name of the queue, or
encapsulating a uniform resource identifier (URI) that identifies the
queue.
Returns:
The Destination object representing the queue.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
The scope of the temporary queue is the connection. Only the sessions created by
the connection can use the temporary queue.
The scope of the temporary topic is the connection. Only the sessions created by
the connection can use the temporary topic.
The temporary topic remains until it is explicitly deleted, or the connection ends,
whichever is the sooner.
Create a text message whose body is initialized with the specified text.
Parameters:
text (input)
A String object encapsulating the text to initialize the body of the
text message.
None
Returns:
The TextMessage object.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Get the acknowledgement mode for the session. The acknowledgement mode is
specified when the session is created.
Get the handle that a C application would use to access the session.
Parameters:
None
Returns:
The handle for the session.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
recover – Recover
Interface:
xmsVOID recover() const;
Recover the session. Message delivery is stopped and then restarted with the
oldest unacknowledged message.
rollback – Rollback
Interface:
xmsVOID rollback() const;
unsubscribe – Unsubscribe
Interface:
xmsVOID unsubscribe(const String & subscriptionName) const;
Delete a durable subscription. The messaging server deletes the record of the
durable subscription that it is maintaining and does not send any more messages
to the durable subscriber.
Inherited methods
The following methods are inherited from the PropertyContext class:
getBooleanProperty, getByteProperty, getBytesProperty, getCharProperty,
getDoubleProperty, getFloatProperty, getIntProperty, getLongProperty,
getObjectProperty, getProperty, getShortProperty, getStringProperty,
setBooleanProperty, setByteProperty, setBytesProperty, setCharProperty,
setDoubleProperty, setFloatProperty, setIntProperty, setLongProperty,
setObjectProperty, setProperty, setShortProperty, setStringProperty
StreamMessage
A stream message is a message whose body comprises a stream of values, where
each value has an associated data type.
Inheritance hierarchy:
When an application reads a value from the message stream, the value can be
converted by XMS into another data type. For more information about this form of
implicit conversion, see “Stream messages” on page 105.
Methods
readBoolean – Read Boolean Value
Interface:
xmsBOOL readBoolean() const;
Read an 8-byte double precision floating point number from the message stream.
Parameters:
None
Returns:
The double precision floating point number that is read.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Read a value from the message stream, and return its data type.
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
buffer (output)
The buffer to contain the value, which is returned as an array of
bytes. If the value is a string and data conversion is required, this
is the value after conversion.
If you specify a null pointer on input, the call skips over the value
without reading it.
bufferLength (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the value is not returned, but its length is returned in the
actualLength parameter.
actualLength (output)
The length of the value in bytes. If the value is a string and data
conversion is required, this is the length after conversion. If you
specify a null pointer on input, the length is not returned.
Returns:
The data type of the value, which is one of the following object types:
XMS_OBJECT_TYPE_BOOL
XMS_OBJECT_TYPE_BYTE
XMS_OBJECT_TYPE_BYTEARRAY
XMS_OBJECT_TYPE_CHAR
XMS_OBJECT_TYPE_DOUBLE
Read a string from the message stream. If required, XMS converts the characters in
the string into the local code page.
Parameters:
None
Returns:
A String object encapsulating the string that is read. If data conversion is
required, this is the string after conversion.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
reset – Reset
Interface:
xmsVOID reset() const;
Write a character to the message stream as 2 bytes, high order byte first.
Parameters:
value (input)
The character to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a double precision floating point number to a long integer and write the
long integer to the message stream as 8 bytes, high order byte first.
Parameters:
value (input)
The double precision floating point number to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Convert a floating point number to an integer and write the integer to the message
stream as 4 bytes, high order byte first.
Parameters:
value (input)
The floating point number to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write an integer to the message stream as 4 bytes, high order byte first.
Parameters:
value (input)
The integer to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_WRITABLE_EXCEPTION
Write a long integer to the message stream as 8 bytes, high order byte first.
Parameters:
value (input)
The long integer to be written.
Returns:
Void
Exceptions:
v XMS_X_GENERAL_EXCEPTION
Write a short integer to the message stream as 2 bytes, high order byte first.
Parameters:
value (input)
The short integer to be written.
Returns:
Void
Exceptions:
Inherited methods
The following methods are inherited from the Message class:
clearBody, clearProperties, getHandle,
getJMSCorrelationID,getJMSDeliveryMode, getJMSDestination,
getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered,
getJMSReplyTo, getJMSTimestamp, getJMSType, getProperties, isNull,
propertyExists, setJMSCorrelationID, setJMSDeliveryMode, setJMSDestination,
setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered,
setJMSReplyTo, setJMSTimestamp, setJMSType
String
A String object encapsulates a string. This class is a helper class.
Inheritance hierarchy:
None
Constructors
String – Create String
Interface:
String();
Methods
~String – Delete String
Interface:
virtual ~String();
Concatenate the string encapsulated by the String object with the string
encapsulated by a second String object.
Parameters:
string (input)
The second String object.
Returns:
The original String object encapsulating the concatenated strings.
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
For more information about how to use this method, see “C++ methods that return
a byte array” on page 72.
Parameters:
value (output)
The buffer to contain the string.
length (input)
The length of the buffer in bytes. If you specify XMSC_QUERY_SIZE
instead, the string is not returned, but its length is returned in the
actualLength parameter.
actualLength (output)
The length of the string in bytes. If you specify a null pointer on
input, the length is not returned.
Returns:
Void
Thread context:
Any
Exceptions:
v XMS_X_GENERAL_EXCEPTION
TextMessage
A text message is a message whose body comprises a string.
Inheritance hierarchy:
xms::PropertyContext
|
+----xms::Message
|
+----xms::TextMessage
Methods
getText – get Text
Interface:
String getText() const;
Get the string that forms the body of the text message. If required, XMS converts
the characters in the string into the local code page.
Parameters:
None
Returns:
A String object encapsulating the string that is read. If data conversion is
required, this is the string after conversion.
Exceptions:
v XMS_X_GENERAL_EXCEPTION
v XMS_X_MESSAGE_NOT_READABLE_EXCEPTION
v XMS_X_MESSAGE_EOF_EXCEPTION
Set the string that forms the body of the text message.
Parameters:
value (input)
A String object encapsulating the string to be set.
Inherited methods
The following methods are inherited from the Message class:
clearBody, clearProperties, getHandle,
getJMSCorrelationID,getJMSDeliveryMode, getJMSDestination,
getJMSExpiration, getJMSMessageID, getJMSPriority, getJMSRedelivered,
getJMSReplyTo, getJMSTimestamp, getJMSType, getProperties, isNull,
propertyExists, setJMSCorrelationID, setJMSDeliveryMode, setJMSDestination,
setJMSExpiration, setJMSMessageID, setJMSPriority, setJMSRedelivered,
setJMSReplyTo, setJMSTimestamp, setJMSType
TransactionInProgressException
XMS throws this exception if an application requests an operation that is not valid
because a transaction is in progress.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::TransactionInProgressException
Inherited methods
The following methods are inherited from the Exception class:
dump, getErrorCode, getErrorData, getErrorString, getHandle, getJMSException,
getLinkedException, isNull
TransactionRolledBackException
XMS throws this exception if an application calls Session.commit() to commit the
current transaction, but the transaction is subsequently rolled back.
Inheritance hierarchy:
std::exception
|
+----xms::Exception
|
+----xms::TransactionRolledBackException
If an application defines its own properties of the objects discussed in this chapter,
it does not cause an error, but it might cause unpredictable results.
Properties of Connection
An overview of the properties of the Connection object, with links to more detailed
reference information.
Table 34. Properties of Connection
Name of property Description
XMSC_CLIENT_CCSID The identifier (CCSID) of the coded character set, or code
page, used by a connection, session, message producer, or
message consumer.
XMSC_WPM_CONNECTION_PROTOCOL The communications protocol used for the connection to the
messaging engine. This property is read-only.
XMSC_WPM_HOST_NAME The host name or IP address of the system that contains the
messaging engine to which the application is connected. This
property is read-only.
XMSC_WPM_ME_NAME The name of the messaging engine to which the application is
connected. This property is read-only.
XMSC_WPM_PORT The number of the port listened on by the messaging engine
to which the application is connected. This property is
read-only.
A Connection object also has read-only properties that are derived from the
properties of the connection factory that was used to create the connection. These
Properties of ConnectionFactory
An overview of the properties of the ConnectionFactory object, with links to more
detailed reference information.
Table 35. Properties of ConnectionFactory
Name of property Description
XMSC_ASYNC_EXCEPTIONS This property determines whether XMS informs an
ExceptionListener only when a connection is broken, or when
any exception occurs asynchronously to a XMS API call. This
applies to all Connections created from this
ConnectionFactory that have an ExceptionListener registered.
XMSC_CLIENT_CCSID The identifier (CCSID) of the coded character set, or code
page, used by a connection, session, message producer, or
message consumer.
XMSC_CLIENT_ID The client identifier for a connection.
XMSC_CONNECTION_TYPE The type of messaging server to which an application
connects.
XMSC_PASSWORD A password that can be used to authenticate the application
when it attempts to connect to a messaging server.
XMSC_RTT_CONNECTION_PROTOCOL The communications protocol used for a real-time connection
to a broker.
XMSC_RTT_HOST_NAME The host name or IP address of the system on which a broker
resides.
XMSC_RTT_LOCAL_ADDRESS The host name or IP address of the local network interface to
be used for a real-time connection to a broker.
XMSC_RTT_MULTICAST The multicast setting for a connection factory or destination.
XMSC_RTT_PORT The number of the port on which a broker listens for
incoming requests.
XMSC_USERID A user identifier that can be used to authenticate the
application when it attempts to connect to a messaging server.
XMSC_WMQ_BROKER_CONTROLQ The name of the control queue used by a broker.
Note: This property has no effect for an application
connected to a WebSphere MQ V7.0 and above queue
manager unless the XMSC_WMQ_PROVIDER_VERSION
property of the connection factory is set to a version number
less than 7.
XMSC_WMQ_BROKER_PUBQ The name of the queue monitored by a broker where
applications send messages that they publish.
Note: This property has no effect for an application
connected to a WebSphere MQ V7.0 and above queue
manager unless the XMSC_WMQ_PROVIDER_VERSION
property of the connection factory is set to a version number
less than 7.
Properties of ConnectionMetaData
An overview of the properties of the ConnectionMetaData object, with links to
more detailed reference information.
Table 36. Properties of ConnectionMetaData
Name of property Description
XMSC_JMS_MAJOR_VERSION The major version number of the JMS specification upon
which XMS is based. This property is read-only.
XMSC_JMS_MINOR_VERSION The minor version number of the JMS specification upon
which XMS is based. This property is read-only.
XMSC_JMS_VERSION The version identifier of the JMS specification upon which
XMS is based. This property is read-only.
XMSC_MAJOR_VERSION The version number of the XMS client. This property is
read-only.
XMSC_MINOR_VERSION The release number of the XMS client. This property is
read-only.
XMSC_PROVIDER_NAME The provider of the XMS client. This property is read-only.
XMSC_VERSION The version identifier of the XMS client. This property is
read-only.
Properties of InitialContext
An overview of the properties of the InitialContext object, with links to more
detailed reference information.
Table 38. Properties of InitialContext
Name of property Description
XMSC_IC_PROVIDER_URL Used to locate the JNDI naming directory so that the COS
naming service does not need to be on the same machine as
the web service.
XMSC_IC_SECURITY_AUTHENTICATION Based on the Java Context interface
SECURITY_AUTHENTICATION. This property is only
applicable to the COS naming context.
XMSC_IC_SECURITY_CREDENTIALS Based on the Java Context interface
SECURITY_CREDENTIALS. This property is only applicable
to the COS naming context.
XMSC_IC_SECURITY_PRINCIPAL Based on the Java Context interface SECURITY_PRINCIPAL.
This property is only applicable to the COS naming context.
XMSC_IC_SECURITY_PROTOCOL Based on the Java Context interface SECURITY_PROTOCOL
This property is only applicable to the COS naming context.
XMSC_IC_URL For LDAP and FileSystem contexts, the address of the
repository containing administered objects. For COS naming
contexts, the address of the web service that looks up the
objects in the directory.
Properties of Message
An overview of the properties of the Message object, with links to more detailed
reference information.
JMS_IBM_MQMD* properties
IBM Message Service Client for C/C++ enables client applications to read/write
MQMD fields using APIs. It also allows access to MQ message data. By default
access to MQMD is disabled and must be enabled explicitly by the application
using Destination properties XMSC_WMQ_MQMD_WRITE_ENABLED and
XMSC_WMQ_MQMD_READ_ENABLED. These two properties are independent of
each other.
All MQMD fields except StrucId and Version are exposed as additional Message
object properties and are prefixed JMS_IBM_MQMD.
Sending messages
All MQMD fields except StrucId and Version are represented. These properties
refer only to the MQMD fields; where a property occurs both in the MQMD and in
the MQRFH2 header, the version in the MQRFH2 is not set or extracted. Any of
these properties can be set, except JMS_IBM_MQMD_BackoutCount. Any value set
for JMS_IBM_MQMD_BackoutCount is ignored.
If a property has a maximum length and you supply a value that is too long, the
value is truncated.
Receiving messages
// Create a destination
// ...
Similarly, you can extract the contents of the MQMD fields by setting
XMSC_WMQ_MQMD_READ_ENABLED to true before receiving a message and
then using the get methods of the message, such as getStringProperty. Any
properties received are read-only.
This example results in the value field holding the value of the
MQMD.ApplIdentityData field of a message got from a queue or a topic.
// Create a ConnectionFactory, connection, session, consumer
// ...
// Create a destination
// ...
// Receive a message
// ...
Properties of MessageConsumer
An overview of the properties of the MessageConsumer object, with links to more
detailed reference information.
Table 41. Properties of MessageConsumer
Name of property Description
XMSC_CLIENT_CCSID The identifier (CCSID) of the coded character set, or code
page, used by a connection, session, message producer,
or message consumer.
Properties of MessageProducer
An overview of the properties of the MessageProducer object, with links to more
detailed reference information.
Table 42. Properties of MessageProducer
Name of property Description
XMSC_CLIENT_CCSID The identifier (CCSID) of the coded character set, or code
page, used by a connection, session, message producer, or
message consumer.
Properties of Session
An overview of the properties of the Session object, with links to more detailed
reference information.
Table 43. Properties of Session
Name of property Description
XMSC_CLIENT_CCSID The identifier (CCSID) of the coded character set, or code
page, used by a connection, session, message producer, or
message consumer.
Property definitions
This section provides a definition of each object property.
Properties whose names commence with one of the following prefixes are relevant
only for the specified type of connection:
Unless stated otherwise in their definitions, the remaining properties are relevant
for all types of connection. The names of the properties are defined as named
constants in the header file xmsc.h. Properties whose names commence with the
prefix JMSX are JMS defined properties of a message, and properties whose names
commence with the prefix JMS_IBM are IBM defined properties of a message. For
more information about the properties of messages, see “Properties of an XMS
message” on page 98.
Unless stated otherwise in its definition, each property is relevant in both the
point-to-point and publish/subscribe domains.
An application can get and set the value of any property, unless the property is
designated as read-only.
JMS_IBM_ArmCorrelator
Data type:
String
Property of:
Message
The value for this property can be obtained using the GetStringProperty method.
The identifier (CCSID) of the coded character set, or code page, that the strings of
character data in the body of the message will be in when the XMS client forwards
the message to its intended destination. In XMS this property has a numeric value
and maps to CCSID. However, this property is based on a JMS property so has a
string type value and maps to the Java character set that represents this numeric
CCSID. This property overrides any CCSID specified for the destination by the
XMSC_WMQ_CCSID property.
JMS_IBM_ENCODING
Data type:
xmsINT
Property of:
Message
How numerical data in the body of the message will be represented when the XMS
client forwards the message to its intended destination. This property overrides
any encoding specified for the destination by the XMSC_WMQ_ENCODING
property. The property specifies the representation of binary integers, packed
decimal integers, and floating point numbers.
The valid values of the property are the same as the values that can be specified in
the Encoding field of a message descriptor. For more information about the
Encoding field, see the WebSphere MQ Application Programming Reference.
An application can use the following named constants to set the property:
To form a value for the property, the application can add together three of these
constants as follows:
v A constant whose name commences with MQENC_INTEGER, to specify the
representation of binary integers
JMS_IBM_EXCEPTIONMESSAGE
Data type:
String
Property of:
Message
Text that describes why the message was sent to the exception destination. This
property is read-only.
JMS_IBM_EXCEPTIONPROBLEMDESTINATION
Data type:
String
Property of:
Message
The name of the destination that the message was at before the message was sent
to the exception destination.
JMS_IBM_EXCEPTIONREASON
Data type:
xmsINT
Property of:
Message
A reason code indicating the reason why the message was sent to the exception
destination.
For a list of all possible reason codes, see the definition of the
com.ibm.websphere.sib.SIRCConstants class in the documentation generated by the
Javadoc tool, as supplied with WebSphere Application Server.
The time when the message was sent to the exception destination.
The time is expressed in milliseconds since 00:00:00 GMT on the 1 January 1970.
JMS_IBM_FEEDBACK
Data type:
xmsINT
Property of:
Message
The valid values of the property are the feedback codes and reason codes that can
be specified in the Feedback field of a message descriptor. For more information
about the Feedback field, see the WebSphere MQ Application Programming Reference.
JMS_IBM_FORMAT
Data type:
String
Property of:
Message
The valid values of the property are the same as the values that can be specified in
the Format field of a message descriptor. For more information about the Format
field, see the WebSphere MQ Application Programming Reference.
JMS_IBM_LAST_MSG_IN_GROUP
Data type:
xmsBOOL
Property of:
Message
This property is ignored in the publish/subscribe domain and is not relevant when
an application connects to a service integration bus.
JMS_IBM_MSGTYPE
Data type:
xmsINT
Property of:
Message
These values correspond to the message types that can be specified in the MsgType
field of a message descriptor. For more information about the MsgType field, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_PUTAPPLTYPE
Data type:
xmsINT
Property of:
Message
The valid values of the property are the application types that can be specified in
the PutApplType field of a message descriptor. For more information about the
PutApplType field, see the WebSphere MQ Application Programming Reference.
The valid values of the property are the same as the values that can be specified in
the PutDate field of a message descriptor. For more information about the PutDate
field, see the WebSphere MQ Application Programming Reference.
JMS_IBM_PUTTIME
Data type:
String
Property of:
Message
The valid values of the property are the same as the values that can be specified in
the PutTime field of a message descriptor. For more information about the PutTime
field, see the WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_COA
Data type:
xmsINT
Property of:
Message
Request confirm on arrival report messages, specifying how much application data
from the original message must be included in a report message.
These values correspond to report options that can be specified in the Report field
of a message descriptor. For more information about these options, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_COD
Data type:
xmsINT
Property of:
Message
These values correspond to report options that can be specified in the Report field
of a message descriptor. For more information about these options, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_DISCARD_MSG
Data type:
xmsINT
Property of:
Message
JMS_IBM_REPORT_EXCEPTION
Data type:
xmsINT
Property of:
Message
Request exception report messages, specifying how much application data from the
original message must be included in a report message.
These values correspond to report options that can be specified in the Report field
of a message descriptor. For more information about these options, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_EXPIRATION
Data type:
xmsINT
Property of:
Message
Request expiration report messages, specifying how much application data from
the original message must be included in a report message.
These values correspond to report options that can be specified in the Report field
of a message descriptor. For more information about these options, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_NAN
Data type:
xmsINT
Property of:
Message
The value MQRO_NAN corresponds to a report option that can be specified in the
Report field of a message descriptor. For more information about this option, see
the WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_PAN
Data type:
xmsINT
Property of:
Message
The value MQRO_PAN corresponds to a report option that can be specified in the
Report field of a message descriptor. For more information about this option, see
the WebSphere MQ Application Programming Reference.
Request that the correlation identifier of any report or reply message is the same as
that of the original message.
These values correspond to report options that can be specified in the Report field
of a message descriptor. For more information about these options, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_REPORT_PASS_MSG_ID
Data type:
xmsINT
Property of:
Message
Request that the message identifier of any report or reply message is the same as
that of the original message.
These values correspond to report options that can be specified in the Report field
of a message descriptor. For more information about these options, see the
WebSphere MQ Application Programming Reference.
JMS_IBM_RETAIN
Data type:
xmsINT
426 Message Service Client for C/C++
Property of:
Message
Setting this property indicates to the queue manager to treat a message as Retained
Publication. When a subscriber receives messages from topics, it may receive
additional messages immediately after subscribing, beyond those that would have
been received in previous releases. These are the optional retained publication(s)
for the topic(s) subscribed. For each topic matching the subscription, if there is a
retained publication it will be made available for delivery to the subscribing
message consumer.
RETAIN_PUBLICATION is the only valid value for this property. By default this
property is not set.
JMS_IBM_SYSTEM_MESSAGEID
Data type:
String
Property of:
Message
An identifier that identifies the message uniquely within the service integration
bus. This property is read-only.
JMS_TOG_ARM_Correlator
Data type:
String
Property of:
Message
The value for this property can be obtained using the GetStringProperty method.
This property is the JMS defined property with the JMS name JMSXAppID. For
more information about the property, see the Java Message Service Specification,
Version 1.1.
JMSX_DELIVERY_COUNT
Data type:
xmsINT
Property of:
Message
This property is the JMS defined property with the JMS name JMSXDeliveryCount.
For more information about the property, see the Java Message Service Specification,
Version 1.1.
JMSX_GROUPID
Data type:
String
Property of:
Message
This property is the JMS defined property with the JMS name JMSXGroupID. For
more information about the property, see the Java Message Service Specification,
Version 1.1.
JMSX_GROUPSEQ
Data type:
xmsINT
This property is the JMS defined property with the JMS name JMSXGroupSeq. For
more information about the property, see the Java Message Service Specification,
Version 1.1.
JMSX_USERID
Data type:
String
Property of:
Message
The user identifier associated with the application that sent the message.
This property is the JMS defined property with the JMS name JMSXUserID. For
more information about the property, see the Java Message Service Specification,
Version 1.1.
XMSC_ASYNC_EXCEPTIONS
Data type:
xmsINT
Property of:
ConnectionFactory
The identifier (CCSID) of the coded character set, or code page, used by a
connection, session, message producer, or message consumer. This property is used
in C and C++ only: it is not required in .NET. For further information, see “Coded
character set identifiers” on page 56.
The following named constants are defined for certain Unicode CCSIDs and can be
used when setting the property:
Instead of a CCSID, the property can have one of the following special values:
XMSC_CCSID_PROCESS
The object is using the code page identified by the process CCSID.
XMSC_CCSID_HOST
The object is using the code page identified by the CCSID that is derived
from the environment in which the application is running.
XMSC_CCSID_NO_CONVERSION
The character data in messages received by the object is not converted.
For more information about the property, including how it is set, see “Coded
character set identifiers” on page 56.
XMSC_CLIENT_ID
Data type:
String
Property of:
ConnectionFactory
XMSC_CONNECTION_TYPE
Data type:
xmsINT
XMSC_DELIVERY_MODE
Data type:
xmsINT
Property of:
Destination
Name used in a URI:
persistence (for a WebSphere MQ destination)
deliveryMode (for a WebSphere default messaging provider destination)
XMSC_IC_PROVIDER_URL
Data type:
String
Property of:
InitialContext
Used to locate the JNDI naming directory so that the COS naming service does not
need to be on the same machine as the web service.
XMSC_IC_SECURITY_AUTHENTICATION
Data type:
String
Property of:
InitialContext
XMSC_IC_SECURITY_CREDENTIALS
Data type:
String
Property of:
InitialContext
XMSC_IC_SECURITY_PROTOCOL
Data type:
String
Property of:
InitialContext
XMSC_IC_URL
Data type:
String
Property of:
InitialContext
For LDAP and FileSystem contexts, the address of the repository containing
administered objects.
For COS naming contexts, the address of the web service that looks up the objects
in the directory.
XMSC_IS_SUBSCRIPTION_MULTICAST
Data type:
xmsBOOL
Property of:
MessageConsumer
Indicates whether messages are being delivered to the message consumer using
WebSphere MQ Multicast Transport. This property is read-only.
The value of the property is xmsTRUE if messages are being delivered to the
message consumer using WebSphere MQ Multicast Transport. Otherwise, the value
is xmsFALSE.
XMSC_IS_SUBSCRIPTION_RELIABLE_MULTICAST
Data type:
xmsBOOL
Indicates whether messages are being delivered to the message consumer using
WebSphere MQ Multicast Transport with a reliable quality of service. This property
is read-only.
The value of the property is xmsTRUE if messages are being delivered to the
message consumer using WebSphere MQ Multicast Transport with a reliable
quality of service. Otherwise, the value is xmsFALSE.
XMSC_JMS_MAJOR_VERSION
Data type:
xmsINT
Property of:
ConnectionMetaData
The major version number of the JMS specification upon which XMS is based. This
property is read-only.
XMSC_JMS_MINOR_VERSION
Data type:
xmsINT
Property of:
ConnectionMetaData
The minor version number of the JMS specification upon which XMS is based. This
property is read-only.
XMSC_JMS_VERSION
Data type:
String
Property of:
ConnectionMetaData
The version identifier of the JMS specification upon which XMS is based. This
property is read-only.
XMSC_MAJOR_VERSION
Data type:
xmsINT
Property of:
ConnectionMetaData
XMSC_PASSWORD
Data type:
Byte array
Property of:
ConnectionFactory
If you are connecting to WebSphere MQ, and you set the XMSC_USERID property
of the connection factory, it must match the userid of the logged on user. If you do
not set these properties, the queue manager will use the userid of the logged on
user by default. If you require further connection-level authentication of individual
users you can write a client authentication exit which is configured in WebSphere
MQ. You can learn more about creating a client authentication exit in the
Authentication topic in the WebSphere MQ Clients manual.
XMSC_PRIORITY
Data type:
xmsINT
Property of:
Destination
Name used in a URI:
priority
XMSC_PROVIDER_NAME
Data type:
String
Property of:
ConnectionMetaData
XMSC_RTT_CONNECTION_PROTOCOL
Data type:
xmsINT
Property of:
ConnectionFactory
XMSC_RTT_HOST_NAME
Data type:
String
Property of:
ConnectionFactory
XMSC_RTT_LOCAL_ADDRESS
Data type:
String
Property of:
ConnectionFactory
The host name or IP address of the local network interface to be used for a
real-time connection to a broker.
This property is useful only if the system on which the application is running has
two or more network interfaces and you need to be able to specify which interface
must be used for a real-time connection. If the system has only one network
interface, only that interface can be used. If the system has two or more network
interfaces and the property is not set, the interface is selected at random.
XMSC_RTT_MULTICAST
Data type:
xmsINT
Property of:
ConnectionFactory and Destination
Name used in a URI:
mulicast
XMSC_RTT_PORT
Data type:
xmsINT
Property of:
ConnectionFactory
The number of the port on which a broker listens for incoming requests. On the
broker, you must configure a Real-timeInput or Real-timeOptimizedFlow message
processing node to listen on this port.
XMSC_TIME_TO_LIVE
Data type:
xmsINT
Property of:
Destination
Name used in a URI:
expiry (for a WebSphere MQ destination)
timeToLive (for a WebSphere default messaging provider destination)
XMSC_USERID
Data type:
String
Property of:
ConnectionFactory
A user identifier that can be used to authenticate the application when it attempts
to connect to a messaging server. The user identifier is used in conjunction with
the XMSC_PASSWORD property.
If you are connecting to WebSphere MQ, and you set the XMSC_USERID property
of the connection factory, it must match the userid of the logged on user. If you do
not set these properties, the queue manager will use the userid of the logged on
user by default. If you require further connection-level authentication of individual
users you can write a client authentication exit which is configured in WebSphere
MQ. You can learn more about creating a client authentication exit in the
Authentication topic in the WebSphere MQ Clients manual.
XMSC_WMQ_BROKER_CONTROLQ
Data type:
String
Property of:
ConnectionFactory
XMSC_WMQ_BROKER_PUBQ
Data type:
String
Property of:
ConnectionFactory
The name of the queue monitored by a broker where applications send messages
that they publish.
XMSC_WMQ_BROKER_QMGR
Data type:
String
Property of:
ConnectionFactory
XMSC_WMQ_BROKER_SUBQ
Data type:
String
The name of the subscriber queue must start with the following characters:
SYSTEM.JMS.ND.
If you want all nondurable message consumers to share the same subscriber queue,
specify the complete name of the shared queue. A queue with the specified name
must exist before an application can create a nondurable message consumer.
If you want each nondurable message consumer to retrieve messages from its own
exclusive subscriber queue, specify a queue name that ends with an asterisk (*).
Subsequently, when an application creates a nondurable message consumer, the
XMS client creates a dynamic queue for exclusive use by the message consumer.
The XMS client uses the value of the property to set the contents of the
DynamicQName field in the object descriptor that is used to create the dynamic
queue.
XMSC_WMQ_BROKER_VERSION
Data type:
xmsINT
Property of:
ConnectionFactory and Destination
Name used in a URI:
brokerVersion
The type of broker used by the application for a connection or for the destination.
Only a destination that is a topic can have this property.
The application can also use this value if you have migrated
from WebSphere MQ Publish/Subscribe to WebSphere Event
Broker or WebSphere Message Broker but have not changed
the application.
XMSC_WMQ_BROKER_V2 The application is using a broker of WebSphere Event Broker
or WebSphere Message Broker.
XMSC_WMQ_BROKER_UNSPECIFIED After the broker has been migrated from Version 6 to Version
7, set this property so that RFH2 headers are no longer used.
After migration this property is no longer relevant.
XMSC_WMQ_CCSID
Data type:
xmsINT
Property of:
Destination
Name used in a URI:
CCSID
The identifier (CCSID) of the coded character set, or code page, that the strings of
character data in the body of a message will be in when the XMS client forwards
the message to the destination. If set for an individual message, the
JMS_IBM_CHARACTER_SET property overrides the CCSID specified for the
destination by this property.
This property is relevant only to messages sent to the destination, not to messages
received from the destination.
XMSC_WMQ_CHANNEL
Data type:
String
Property of:
ConnectionFactory
XMSC_WMQ_CONNECTION_MODE
Data type:
xmsINT
Property of:
ConnectionFactory
The name of the subscriber queue for a durable subscriber that is receiving
messages from the destination. Only a destination that is a topic can have this
property.
The name of the subscriber queue must start with the following characters:
SYSTEM.JMS.D.
If you want all durable subscribers to share the same subscriber queue, specify the
complete name of the shared queue. A queue with the specified name must exist
before an application can create a durable subscriber.
If you want each durable subscriber to retrieve messages from its own exclusive
subscriber queue, specify a queue name that ends with an asterisk (*).
Subsequently, when an application creates a durable subscriber, the XMS client
creates a dynamic queue for exclusive use by the durable subscriber. The XMS
client uses the value of the property to set the contents of the DynamicQName field in
the object descriptor that is used to create the dynamic queue.
XMSC_WMQ_ENCODING
Data type:
xmsINT
Property of:
Destination
How numerical data in the body of a message will be represented when the XMS
client forwards the message to the destination. If set for an individual message, the
JMS_IBM_ENCODING property overrides the encoding specified for the
destination by this property. The property specifies the representation of binary
integers, packed decimal integers, and floating point numbers.
The valid values of the property are the same as the values that can be specified in
the Encoding field of a message descriptor. For more information about the
Encoding field, see the WebSphere MQ Application Programming Reference.
An application can use the following named constants to set the property:
To form a value for the property, the application can add together three of these
constants as follows:
v A constant whose name commences with MQENC_INTEGER, to specify the
representation of binary integers
v A constant whose name commences with MQENC_DECIMAL, to specify the
representation of packed decimal integers
v A constant whose name commences with MQENC_FLOAT, to specify the
representation of floating point numbers
Alternatively, the application can set the property to MQENC_NATIVE, whose
value is environment dependent.
This property is relevant only to messages sent to the destination, not to messages
received from the destination.
XMSC_WMQ_FAIL_IF_QUIESCE
Data type:
xmsINT
Property of:
ConnectionFactory and Destination
Name used in a URI:
failIfQuiesce
Whether calls to certain methods fail if the queue manager to which the
application is connected is in a quiescing state.
XMSC_WMQ_MESSAGE_BODY
Data type:
xmsINT
Property of:
Destination
Note: This property is not relevant only when an application connects to Service
integration bus
XMSC_WMQ_MQMD_MESSAGE_CONTEXT
Data type:
xmsINT
Determines what level of message context is to be set by the XMS application. The
application must be running with appropriate context authority for this property to
take effect.
XMSC_WMQ_MQMD_READ_ENABLED
Data type:
xmsINT
Property of:
Destination
XMSC_WMQ_MQMD_WRITE_ENABLED
Data type:
xmsINT
Property of:
Destination
This property determines whether a XMS application can set the values of MQMD
fields or not.
XMSC_WMQ_PUT_ASYNC_ALLOWED
Data type:
xmsINT
Property of:
Destination
XMSC_WMQ_READ_AHEAD_ALLOWED
Data type:
xmsINT
Property of:
Destination
This property determines whether message consumers and queue browsers are
allowed to use read ahead to get non-persistent, non-transactional messages from
this destination into an internal buffer before receiving them.
This property will be ignored for Queue Browsers since during browse the
messages will still be available in the queues.
Notes:
v Abnormal application termination
All the messages in the read ahead buffer will be lost when a XMS application
terminates abruptly.
v Implications on Transactions
The read ahead will be disabled when the applications use transaction. So, the
application will not be seeing any difference in the behavior when they use
transacted sessions.
v Implications of Session Acknowledgement modes
The read ahead will be enabled when the on a non transacted session when the
acknowledgement modes are either XMSC_AUTO_ACKNOWLEDGE or
XMSC_DUPS_OK_ACKNOWLEDGE. The read ahead will be disabled if the
session acknowledgement mode is XMSC_CLIENT_ACKNOWLEDGE
irrespective of transacted or non transacted sessions.
v Implications on Queue Browsers and Queue Browser Selectors
The Queue Browsers and Queue Browser Selectors, used in XMS applications,
will get the performance advantage from read ahead. Closing the Queue
Browser won’t impact, since the message is still available in the queue for ay
further operations. There will not be any other implication on queue browsers
and queue browser selectors apart from performance benefits of read ahead.
v Implications of read ahead destination properties on WebSphere Message
Broker v6 or earlier queue managers
For further information about the Read Ahead, see WebSphere MQ Application
Programming Guide book and WebSphere MQ Application Programming
Reference book.
XMSC_WMQ_HOST_NAME
Data type:
String
Property of:
ConnectionFactory
The host name or IP address of the system on which a queue manager resides.
XMSC_WMQ_LOCAL_ADDRESS
Data type:
String
Property of:
ConnectionFactory
For a connection to a queue manager, this property specifies the local network
interface to be used, or the local port or range of local ports to be used, or both.
XMSC_WMQ_MESSAGE_SELECTION
Data type:
xmsINT
Property of:
ConnectionFactory
Determines whether message selection is done by the XMS client or by the broker.
XMSC_WMQ_MSG_BATCH_SIZE
Data type:
xmsINT
Property of:
ConnectionFactory
The value of the property is a positive integer, and the default value is 10. Only
consider setting the property to a different value if you have a specific
performance problem that you need to address.
XMSC_WMQ_POLLING_INTERVAL
Data type:
xmsINT
Property of:
ConnectionFactory
If each message listener within a session has no suitable message on its queue, this
is the maximum interval, in milliseconds, that elapses before each message listener
tries again to get a message from its queue.
The value of the property is a positive integer. The default value is 5000.
XMSC_WMQ_PORT
Data type:
xmsINT
The number of the port on which a queue manager listens for incoming requests.
XMSC_WMQ_PROVIDER_VERSION
Data type:
String
Property of:
ConnectionFactory
The version, release, modification level and fix pack of the queue manager to
which the application intends to connect. Valid values for this property are:
v Unspecified
Or a string in one of the following formats
v V.R.M.F
v V.R.M
v V.R
v V
Note:
v No socket sharing happens if XMSC_WMQ_PROVIDER_VERSION is set
to 6. 2.
v Connection will fail if XMSC_WMQ_PROVIDER_VERSION is set to 7 and
on the server SHARECNV for the channel has been set 0.
v MQ v7 specific features will be disabled if
XMSC_WMQ_PROVIDER_VERSION is set to UNSPECIFIED and
SHARECNV is set to 0.
The version of WebSphere MQ Client also plays major role in whether a XMS
client application can use WebSphere MQ version 7 specific features. The following
table describes the behavior.
XMSC_WMQ_PUB_ACK_INTERVAL
Data type:
xmsINT
Property of:
ConnectionFactory
The number of messages published by a publisher before the XMS client requests
an acknowledgement from the broker.
If you lower the value of this property, the client requests acknowledgements more
often, and therefore the performance of the publisher decreases. If you raise the
value, the client takes a longer time to throw an exception if the broker fails.
The value of the property is a positive integer. The default value is 25.
XMSC_WMQ_QMGR_CCSID
Data type:
xmsINT
Property of:
ConnectionFactory
The identifier (CCSID) of the coded character set, or code page, in which fields of
character data defined in the Message Queue Interface (MQI) are exchanged
between the XMS client and the WebSphere MQ client. This property does not
apply to the strings of character data in the bodies of messages.
When an XMS application connects to a queue manager in client mode, the XMS
client links to the WebSphere MQ client. The information exchanged between the
two clients contains fields of character data that are defined in the MQI. Under
normal circumstances, the WebSphere MQ client assumes that these fields are in
the code page of the system on which the clients are running. If the XMS client
provides and expects to receive these fields in a different code page, you must set
this property to inform the WebSphere MQ client.
When the WebSphere MQ client forwards these fields of character data to the
queue manager, the data in them must be converted if necessary into the code
page used by the queue manager. Similarly, when the WebSphere MQ client
XMSC_WMQ_QUEUE_MANAGER
Data type:
String
Property of:
ConnectionFactory
XMSC_WMQ_RECEIVE_EXIT
Data type:
String
Property of:
ConnectionFactory
The value of the property is a string of one or more items separated by commas,
where each item identifies a channel receive exit and has the following format:
libraryName(entryPointName)
For more information about the format of the string that identifies an individual
channel receive exit, see WebSphere MQ Intercommunication.
XMSC_WMQ_RECEIVE_EXIT_INIT
Data type:
String
Property of:
ConnectionFactory
The user data that is passed to channel receive exits when they are called.
The value of the property is a string of one or more items of user data separated
by commas. By default, the property is not set.
XMSC_WMQ_SECURITY_EXIT
Data type:
String
Property of:
ConnectionFactory
The value of the property is a string that identifies a channel security exit and has
the following format:
libraryName(entryPointName)
For more information about the format of the string that identifies a channel
security exit, see WebSphere MQ Intercommunication. The maximum length of the
string is 128 characters.
XMSC_WMQ_SECURITY_EXIT_INIT
Data type:
String
Property of:
ConnectionFactory
The user data that is passed to a channel security exit when it is called.
XMSC_WMQ_SEND_EXIT
Data type:
String
The value of the property is a string of one or more items separated by commas,
where each item identifies a channel send exit and has the following format:
libraryName(entryPointName)
For more information about the format of the string that identifies an individual
channel send exit, see WebSphere MQ Intercommunication.
XMSC_WMQ_SEND_EXIT_INIT
Data type:
String
Property of:
ConnectionFactory
The user data that is passed to channel send exits when they are called.
The value of the property is a string of one or more items of user data separated
by commas. By default, the property is not set.
The rules for specifying user data that is passed to a sequence of channel send
exits are the same as those for specifying user data that is passed to a sequence of
channel receive exits. For the rules therefore, see
“XMSC_WMQ_RECEIVE_EXIT_INIT” on page 455.
XMSC_WMQ_SEND_CHECK_COUNT
Data type:
xmsINT
Property of:
ConnectionFactory
The number of send calls to allow between checking for asynchronous put errors,
within a single non-transacted XMS session.
XMSC_WMQ_SHARE_CONV_ALLOWED
Data type:
xmsINT
Whether a client connection can share its socket with other top-level XMS
connections from the same process to the same queue manager, if the channel
definitions match. This property is provided to allow complete isolation of
Connections in separate sockets if required for application development,
maintenance or operational reasons. Setting this property merely indicates to XMS
to make the underlying socket shared. It does not indicate how many connections
will share a single socket. The number of connections sharing a socket is
determined by SHARECONV value which is negotiated between MQI Client and
WMQ Server.
An application can set the following named constants to set the property:
v XMSC_WMQ_SHARE_CONV_ALLOWED_DISABLED - Connections will not
share a socket.
v XMSC_WMQ_SHARE_CONV_ALLOWED_ENABLED - Connections share a
socket.
XMSC_WMQ_SSL_CERT_STORES
Data type:
String
Property of:
ConnectionFactory
The locations of the servers that hold the certificate revocation lists (CRLs) to be
used on an SSL connection to a queue manager.
The value of the property is a list of one or more URLs separated by commas.
Each URL has the following format:
[user[/password]@]ldap://[serveraddress][:portnum][,...]
This format is compatible with, but extended from, the basic MQJMS format.
It is valid to have an empty ’serveraddress’. In this case, XMS assumes that the
value is the string ″localhost″.
The following example shows how this value is supplied at the MQI:
strncpy(pChDef->SSLCipherSpec, "TRIPLE_DES_SHA_US", sizeof(pChDef->SSLCipherSpec));
XMS takes a copy of the first 32 bytes of the string in the correct single-byte code
page into the SSLCipherSpec field of the channel definition structure, MQCD
before calling MQCONNX.
XMSC_WMQ_SSL_CIPHER_SUITE
Data type:
String
XMSC_WMQ_SSL_CRYPTO_HW
Data type:
String
Property of:
ConnectionFactory
For additional information about the format of this property, see WebSphere MQ
Application Programming Reference.
XMS does not interpret or alter the contents of the string. It simply copies the
value supplied, up to a limit of 256 single-byte characters, into the
MQSCO.CryptoHardware field.
XMSC_WMQ_SSL_FIPS_REQUIRED
Data type:
Boolean
Property of:
ConnectionFactory
The value of this property determines whether an application can or cannot use
non-FIPS compliant cipher suites. If this property is set to true, only FIPS
algorithms are used for the client-server connection.
This property can have the following values, which translate to the two canonical
values for MQSCO.FipsRequired:
Table 45. Table of values for MQSCO.FlipsRequired property
Corresponding value of
Value Description MQSCO.FipsRequired
xmsFALSE Any CipherSpec can be used. MQSSL_FIPS_NO (the default)
xmsTRUE Only FIPS-certified cryptographic MQSSL_FIPS_YES
algorithms can be used in the
CipherSpec applying to this client
connection.
XMSC_WMQ_SSL_KEY_REPOSITORY
Data type:
String
The location of the key database file in which keys and certificates are stored.
XMS copies the string, up to a limit of 256 single-byte characters, into the
MQSCO.KeyRepository field. WebSphere MQ interprets this string as a filename,
including the full path.
XMSC_WMQ_SSL_KEY_RESETCOUNT
Data type:
xmsINT
Property of:
ConnectionFactory
The KeyResetCount represents the total number of unencrypted bytes sent and
received within an SSL conversation before the secret key is renegotiated. The
number of bytes includes control information sent by the MCA.
XMS copies the value that you supply for this property into
MQSCO.KeyResetCount before calling MQCONNX.
The default value of this property is zero, which means that secret keys are never
renegotiated. For further information, see the WebSphere MQ Application
Programming Reference.
XMSC_WMQ_SSL_PEER_NAME
Data type:
String
Property of:
ConnectionFactory
There is no list of canonical values for this property. Instead, you must build this
string according to the rules for SSLPEER described in WebSphere MQ Using Java
and WebSphere MQ Security.
XMS copies the string into the correct single-byte code page, and places the correct
values into MQCD.SSLPeerNamePtr and MQCD.SSLPeerNameLength before
calling MQCONNX.
XMSC_WMQ_SYNCPOINT_ALL_GETS
Data type:
xmsBOOL
Property of:
ConnectionFactory
Whether all messages must be retrieved from queues within syncpoint control.
XMSC_WMQ_TARGET_CLIENT
Data type:
xmsINT
Property of:
Destination
Name used in a URI:
targetClient
The prefix used to form the name of the WebSphere MQ dynamic queue that is
created when the application creates an XMS temporary queue.
The rules for forming the prefix are the same as those for forming the contents of
the DynamicQName field in an object descriptor, but the last non blank character
must be an asterisk(*). If the property is not set, the value used is CSQ.* on z/OS
and AMQ.* on the other platforms. By default, the property is not set.
XMSC_WMQ_TEMP_TOPIC_PREFIX
Data type:
String
Property of:
ConnectionFactory, Destination
When creating temporary topics, XMS will generate a topic string of the form
“TEMP/TEMPTOPICPREFIX/unique_id”, or if this property is left with the default
value, just “TEMP/unique_id”. Specifying a non-empty value allows specific
model queues to be defined for creating the managed queues for subscribers to
temporary topics created under this connection.
Any non-null string consisting only of valid characters for a WebSphere MQ topic
string is a valid value for this property.
XMSC_WMQ_TEMPORARY_MODEL
Data type:
String
Property of:
ConnectionFactory
The name of the WebSphere MQ model queue from which a dynamic queue is
created when the application creates an XMS temporary queue.
XMSC_WMQ_WILDCARD_FORMAT
Data type:
xmsINT
When using Publish/Subscribe with WebSphere MQ ‘*’ and ‘?’ are treated as
wildcards. Whereas ‘#’ and ‘+’ are treated as wildcards when using publish
subscribe with WebSphere Message Broker. This property replaces the
XMSC_WMQ_BROKER_VERSION property.
XMSC_WPM_BUS_NAME
Data type:
String
Property of:
ConnectionFactory and Destination
Name used in a URI:
busName
For a connection factory, the name of the service integration bus that the
application connects to or, for a destination, the name of the service integration bus
in which the destination exists.
For a destination that is a topic, this property is the name of the service integration
bus in which the associated topic space exists. This topic space is specified by the
XMSC_WPM_TOPIC_SPACE property.
If the property is not set for a destination, the queue or associated topic space is
assumed to exist in the service integration bus to which the application connects.
XMSC_WPM_CONNECTION_PROTOCOL
Data type:
xmsINT
Property of:
Connection
Value Meaning
XMSC_WPM_CP_HTTP The connection uses HTTP over TCP/IP.
XMSC_WPM_CP_TCP The connection uses TCP/IP.
XMSC_WPM_CONNECTION_PROXIMITY
Data type:
xmsINT
Property of:
ConnectionFactory
The connection proximity setting for the connection. This property determines how
close the messaging engine that the application connects to must be to the
bootstrap server.
Connection
Valid value proximity setting
XMSC_WPM_CONNECTION_PROXIMITY_BUS Bus
XMSC_WPM_CONNECTION_PROXIMITY_CLUSTER Cluster
XMSC_WPM_CONNECTION_PROXIMITY_HOST Host
XMSC_WPM_CONNECTION_PROXIMITY_SERVER Server
XMSC_WPM_DUR_SUB_HOME
Data type:
String
Property of:
ConnectionFactory
Name used in a URI:
durableSubscriptionHome
The name of the messaging engine where all durable subscriptions for a
connection or a destination are managed. Messages to be delivered to the durable
subscribers are stored at the publication point of the same messaging engine.
The host name or IP address of the system that contains the messaging engine to
which the application is connected. This property is read-only.
XMSC_WPM_LOCAL_ADDRESS
Data type:
String
Property of:
ConnectionFactory
For a connection to a service integration bus, this property specifies the local
network interface to be used, or the local port or range of local ports to be used, or
both.
XMSC_WPM_ME_NAME
Data type:
String
Property of:
Connection
The name of the messaging engine to which the application is connected. This
property is read-only.
XMSC_WPM_NON_PERSISTENT_MAP
Data type:
xmsINT
Property of:
ConnectionFactory
The reliability level of nonpersistent messages that are sent using the connection.
For more information about message reliability levels, see the WebSphere
Application Server Information Center.
XMSC_WPM_PERSISTENT_MAP
Data type:
xmsINT
Property of:
ConnectionFactory
For more information about message reliability levels, see the WebSphere
Application Server Information Center.
XMSC_WPM_PORT
Data type:
xmsINT
Property of:
Connection
The number of the port listened on by the messaging engine to which the
application is connected. This property is read-only.
XMSC_WPM_PROVIDER_ENDPOINTS
Data type:
String
Property of:
ConnectionFactory
XMSC_WPM_SSL_CIPHER_SUITE
Data type:
String
Property of:
ConnectionFactory
There is no default for this property. If you want to use SSL or TLS, you must
specify a value for this property, otherwise your application will not be able to
connect successfully to the server.
XMSC_WPM_SSL_KEY_REPOSITORY
Data type:
String
Property of:
ConnectionFactory
A path to the file that is the keyring file containing the public or private keys to be
used in the secure connection.
XMSC_WPM_SSL_KEYRING_LABEL
Data type:
String
Property of:
ConnectionFactory
XMSC_WPM_SSL_KEYRING_PW
Data type:
String
XMSC_WPM_SSL_KEYRING_STASH_FILE
Data type:
String
Property of:
ConnectionFactory
The name of a binary file containing the password of the key repository file.
XMSC_WPM_SSL_FIPS_REQUIRED
Data type:
Boolean
Property of:
ConnectionFactory
The value of this property determines whether an application can or cannot use
non-FIPS compliant cipher suites. If this property is set to true, only FIPS
algorithms are used for the client-server connection.Setting the value of this
property to TRUE prevents the application from using non-FIPS compliant cipher
suites.
By default, the property is set to FALSE (that is, FIPS mode off).
XMSC_WPM_TARGET_GROUP
Data type:
String
Property of:
ConnectionFactory
The name of a target group of messaging engines. The nature of the target group is
determined by the XMSC_WPM_TARGET_TYPE property.
Set this property if you want to restrict the search for a messaging engine to a
subgroup of the messaging engines in the service integration bus. If you want your
application to be able to connect to any messaging engine in the service integration
bus, do not set this property.
XMSC_WPM_TARGET_SIGNIFICANCE
Data type:
xmsINT
Property of:
ConnectionFactory
XMSC_WPM_TARGET_TRANSPORT_CHAIN
Data type:
String
Property of:
ConnectionFactory
The name of the inbound transport chain that the application must use to connect
to a messaging engine.
The value of the property can be the name of any inbound transport chain that is
available in the application server that hosts the messaging engine. The following
named constant is provided for one of the predefined inbound transport chains:
XMSC_WPM_TARGET_TYPE
Data type:
xmsINT
Property of:
ConnectionFactory
XMSC_WPM_TEMP_Q_PREFIX
Data type:
String
Property of:
ConnectionFactory
The prefix used to form the name of the temporary queue that is created in the
service integration bus when the application creates an XMS temporary queue. The
prefix can contain up to 12 characters.
The name of a temporary queue starts with the characters “_Q” followed by the
prefix. The remainder of the name consists of system generated characters.
By default, the property is not set, which means that the name of a temporary
queue does not have a prefix.
XMSC_WPM_TEMP_TOPIC_PREFIX
Data type:
String
Property of:
ConnectionFactory
The prefix used to form the name of a temporary topic that is created by the
application. The prefix can contain up to 12 characters.
The name of a temporary topic starts with the characters “_T” followed by the
prefix. The remainder of the name consists of system generated characters.
XMSC_WPM_TOPIC_SPACE
Data type:
String
Property of:
Destination
Name used in a URI:
topicSpace
The name of the topic space that contains the topic. Only a destination that is a
topic can have this property.
By default, the property is not set, which means that the default topic space is
assumed.
IBM may have patents or pending patent applications covering subject matter
described in this information. The furnishing of this information does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
Intellectual Property Licensing
Legal and Intellectual Property Law
IBM Japan, Ltd.
3-2-12, Roppongi, Minato-ku, Tokyo 106–8711, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore this statement may not apply
to you.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it
believes appropriate without incurring any obligation to you.
Licensees of this program who wish to have information about it for the purpose
of enabling: (i) the exchange of information between independently created
programs and other programs (including this one) and (ii) the mutual use of the
information which has been exchanged, should contact:
IBM United Kingdom Laboratories,
Mail Point 151,
Hursley Park,
Winchester,
Hampshire,
England
SO21 2JN.
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Programming License Agreement, or any equivalent agreement
between us.
COPYRIGHT LICENSE:
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of
International Business Machines Corporation in the United States, other countries,
or both. If these and other IBM trademarked terms are marked on their first
occurrence in this information with a trademark symbol (® or ™), these symbols
indicate U.S. registered or common law trademarks owned by IBM at the time this
information was published. Such trademarks may also be registered or common
law trademarks in other countries. A current list of IBM trademarks is available on
the Web at "Copyright and trademark information" at www.ibm.com/legal/
copytrade.shtml.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the
United States, other countries, or both.
Index 483
P property (continued)
JMSX_USERID 429
persistent messages 41 XMSC_ASYNC_EXCEPTIONS 429
point-to-point messaging 10 XMSC_CLIENT_CCSID 430
Poison messages 48 use in code page conversion 56
primitive types 52 XMSC_CLIENT_ID 430
problem determination XMSC_CONNECTION_TYPE 430
errors that cannot be handled at run time 112 XMSC_DELIVERY_MODE 431
FFDC and trace 113 XMSC_IC_PROVIDER_URL 432
introduction 111 XMSC_IC_SECURITY_AUTHENTICATION 432
runtime errors 111 XMSC_IC_SECURITY_CREDENTIALS 432
process CCSID 56 XMSC_IC_SECURITY_PRINCIPAL 433
process CCSID functions 271 XMSC_IC_SECURITY_PROTOCOL 433
properties XMSC_IC_URL 433
Connection object 403 XMSC_IS_SUBSCRIPTION_MULTICAST 433
ConnectionFactory object 404 XMSC_IS_SUBSCRIPTION_RELIABLE_MULTICAST 433
ConnectionMetaData object 408 XMSC_JMS_MAJOR_VERSION 434
Destination object 409 XMSC_JMS_MINOR_VERSION 434
getting XMSC_JMS_VERSION 434
in C 64 XMSC_MAJOR_VERSION 434
in C++ 73 XMSC_MINOR_VERSION 435
InitialContext object 410 XMSC_PASSWORD 435
introduction 403 XMSC_PRIORITY 435
Message object XMSC_PROVIDER_NAME 436
application defined 101 XMSC_RTT_CONNECTION_PROTOCOL 436
IBM-defined 100 XMSC_RTT_HOST_NAME 436
JMS-defined 99 XMSC_RTT_LOCAL_ADDRESS 437
list of properties 411 XMSC_RTT_MULTICAST 437
MessageConsumer object 415 XMSC_RTT_PORT 438
MessageProducer object 416 XMSC_TIME_TO_LIVE 439
Session object 416 XMSC_USERID 439
setting XMSC_VERSION 440
in C 64 XMSC_WMQ_BROKER_CONTROLQ 440
in C++ 73 XMSC_WMQ_BROKER_PUBQ 440
properties of objects 403 XMSC_WMQ_BROKER_QMGR 440
property XMSC_WMQ_BROKER_SUBQ 440
definitions 416 XMSC_WMQ_BROKER_VERSION 441
introduction 12 XMSC_WMQ_CCSID 442
JMS_IBM_ArmCorrelator 417 XMSC_WMQ_CHANNEL 442
JMS_IBM_CHARACTER_SET 418 XMSC_WMQ_CONNECTION_MODE 442
JMS_IBM_ENCODING 418 XMSC_WMQ_DUR_SUBQ 443
JMS_IBM_EXCEPTIONMESSAGE 419 XMSC_WMQ_ENCODING 443
JMS_IBM_EXCEPTIONPROBLEMDESTINATION 419 XMSC_WMQ_FAIL_IF_QUIESCE 444
JMS_IBM_EXCEPTIONREASON 419 XMSC_WMQ_HOST_NAME 450
JMS_IBM_EXCEPTIONTIMESTAMP 420 XMSC_WMQ_LOCAL_ADDRESS 450
JMS_IBM_FEEDBACK 420 XMSC_WMQ_MESSAGE_BODY 445
JMS_IBM_FORMAT 420 XMSC_WMQ_MESSAGE_SELECTION 451
JMS_IBM_LAST_MSG_IN_GROUP 420 XMSC_WMQ_MQMD_MESSAGE_CONTEXT 445
JMS_IBM_MSGTYPE 421 XMSC_WMQ_MQMD_READ_ENABLED 446
JMS_IBM_PUTAPPLTYPE 421 XMSC_WMQ_MQMD_WRITE_ENABLED 447
JMS_IBM_PUTDATE 422 XMSC_WMQ_MSG_BATCH_SIZE 452
JMS_IBM_PUTTIME 422 XMSC_WMQ_POLLING_INTERVAL 452
JMS_IBM_REPORT_COA 422 XMSC_WMQ_PORT 452
JMS_IBM_REPORT_COD 423 XMSC_WMQ_PROVIDER_VERSION 453
JMS_IBM_REPORT_DISCARD_MSG 423 XMSC_WMQ_PUB_ACK_INTERVAL 454
JMS_IBM_REPORT_EXCEPTION 424 XMSC_WMQ_PUT_ASYNC_ALLOWED 447
JMS_IBM_REPORT_EXPIRATION 424 XMSC_WMQ_QMGR_CCSID 454
JMS_IBM_REPORT_NAN 425 XMSC_WMQ_QUEUE_MANGER 455
JMS_IBM_REPORT_PAN 425 XMSC_WMQ_READ_AHEAD_ALLOWED 448
JMS_IBM_REPORT_PASS_CORREL_ID 426 XMSC_WMQ_READ_AHEAD_CLOSE_POLICY 449
JMS_IBM_REPORT_PASS_MSG_ID 426 XMSC_WMQ_RECEIVE_EXIT 455
JMS_IBM_RETAIN 426 XMSC_WMQ_RECEIVE_EXIT_INIT 455
JMS_IBM_SYSTEM_MESSAGEID 427 XMSC_WMQ_SECURITY_EXIT 456
JMS_TOG_ARM_Correlator 427 XMSC_WMQ_SECURITY_EXIT_INIT 456
JMSX_APPID 428 XMSC_WMQ_SEND_CHECK_COUNT 457
JMSX_DELIVERY_COUNT 428 XMSC_WMQ_SEND_EXIT 456
JMSX_GROUPID 428 XMSC_WMQ_SEND_EXIT_INIT 457
JMSX_GROUPSEQ 428
Index 485
StreamMessage class (continued)
interface definition (continued)
X
for C++ 385 XMS
string compilers 14
C functions accepting as input 67 message model 13
C functions returning by reference 66 object model 10
C functions returning by value 64 operating environments 14
String class threading model 35
interface definition 395 XMSC_ASYNC_EXCEPTIONS property 429
using in C++ 72 XMSC_CLIENT_CCSID property 430
styles of messaging 10 use in code page conversion 56
subscriber queue 46 XMSC_CLIENT_ID property 430
synchronous message delivery 41 XMSC_CONNECTION_TYPE property 430
XMSC_DELIVERY_MODE property 431
XMSC_IC_PROVIDER_URL property 432
XMSC_IC_SECURITY_AUTHENTICATION property 432
T XMSC_IC_SECURITY_CREDENTIALS property 432
temporary destinations 45 XMSC_IC_SECURITY_PRINCIPAL property 433
text message 105 XMSC_IC_SECURITY_PROTOCOL property 433
TextMessage class XMSC_IC_URL property 433
interface definition XMSC_IS_SUBSCRIPTION_MULTICAST property 433
for C 268 XMSC_IS_SUBSCRIPTION_RELIABLE_MULTICAST
for C++ 399 property 433
threading model 35 XMSC_JMS_MAJOR_VERSION property 434
topic uniform resource identifiers (URIs) 42 XMSC_JMS_MINOR_VERSION property 434
trace, configuration 113 XMSC_JMS_VERSION property 434
trademarks 478 XMSC_MAJOR_VERSION property 434
transacted sessions 38 XMSC_MINOR_VERSION property 435
TransactionInProgressException class XMSC_PASSWORD property 435
interface definition 400 XMSC_PRIORITY property 435
TransactionRolledBackException class XMSC_PROVIDER_NAME property 436
interface definition 400 XMSC_RTT_CONNECTION_PROTOCOL property 436
troubleshooting 111 XMSC_RTT_HOST_NAME property 436
tips 115 XMSC_RTT_LOCAL_ADDRESS property 437
XMSC_RTT_MULTICAST property 437
XMSC_RTT_PORT property 438
U XMSC_TIME_TO_LIVE property 439
uniform resource identifiers (URIs) XMSC_USERID property 439
introduction 42 XMSC_VERSION property 440
queue 44 XMSC_WMQ_BROKER_CONTROLQ property 440
topic 42 XMSC_WMQ_BROKER_PUBQ property 440
uninstalling Message Service Client for C/C++ XMSC_WMQ_BROKER_QMGR property 440
AIX 22 XMSC_WMQ_BROKER_SUBQ property 440
Linux 22 XMSC_WMQ_BROKER_VERSION property 441
Windows XMSC_WMQ_CCSID property 442
by running the uninstaller program 22 XMSC_WMQ_CHANNEL property 442
using Add/Remove Programs 22 XMSC_WMQ_CONNECTION_MODE property 442
URI 42 XMSC_WMQ_DUR_SUBQ property 443
XMSC_WMQ_ENCODING property 443
XMSC_WMQ_FAIL_IF_QUIESCE property 444
XMSC_WMQ_HOST_NAME property 450
W XMSC_WMQ_LOCAL_ADDRESS property 450
wildcard characters XMSC_WMQ_MESSAGE_BODY property 445
in topic URIs 42 XMSC_WMQ_MESSAGE_SELECTION property 451
Windows XMSC_WMQ_MQMD_MESSAGE_CONTEXT property 445
AIX XMSC_WMQ_MQMD_READ_ENABLED property 446
installing XMS 15 XMSC_WMQ_MQMD_WRITE_ENABLED property 447
compilers 14 XMSC_WMQ_MSG_BATCH_SIZE property 452
installed directories (C/C++) 21 XMSC_WMQ_POLLING_INTERVAL property 452
installing XMS 15 XMSC_WMQ_PORT property 452
uninstalling Message Service Client for C/C++ XMSC_WMQ_PROVIDER_VERSION property 453
by running the uninstaller program 22 XMSC_WMQ_PUB_ACK_INTERVAL property 454
using Add/Remove Programs 22 XMSC_WMQ_PUT_ASYNC_ALLOWED property 447
writing applications XMSC_WMQ_QMGR_CCSID property 454
general 35 XMSC_WMQ_QUEUE_MANGER property 455
in C 63 XMSC_WMQ_READ_AHEAD_ALLOWED property 448
in C++ 71 XMSC_WMQ_READ_AHEAD_CLOSE_POLICY property 449
XMSC_WMQ_RECEIVE_EXIT property 455
Index 487
488 Message Service Client for C/C++
Sending your comments to IBM
If you especially like or dislike anything about this book, please use one of the
methods listed below to send your comments to IBM.
Feel free to comment on what you regard as specific errors or omissions, and on
the accuracy, organization, subject matter, or completeness of this book.
Please limit your comments to the information in this book and the way in which
the information is presented.
To make comments about the functions of IBM products or systems, talk to your
IBM representative or to your IBM authorized remarketer.
When you send comments to IBM, you grant IBM a nonexclusive right to use or
distribute your comments in any way it believes appropriate, without incurring
any obligation to you.
You can send your comments to IBM in any of the following ways:
v By mail, to this address:
User Technologies Department (MP095)
IBM United Kingdom Laboratories
Hursley Park
WINCHESTER,
Hampshire
SO21 2JN
United Kingdom
v By fax:
– From outside the U.K., after your international access code use
44–1962–816151
– From within the U.K., use 01962–816151
v Electronically, use the appropriate network ID:
– IBM Mail Exchange: GBIBM2Q9 at IBMMAIL
– IBMLink™: HURSLEY(IDRCF)
– Internet: [email protected]
SC34-6984-01
Spine information:
IBM WebSphere Business Integration Version 2.0.1 Message Service Client for C/C++