This book provides programming and reference information for developers working with Sun JavaTM System Message Queue (formerly SunTM ONE Message Queue) 4.3, who want to use the C language binding to the Message Queue Service to send, receive, and process Message Queue messages.
This guide is for developers who want to use the C-API in order to write C or C++ messaging programs that can interact with the Message Queue broker to send and receive JMS messages.
This book assumes that readers are experienced C or C++ programmers and that they are familiar with the Java Message Service specification.
You must read the Sun Java System Message Queue 4.3 Technical Overviewto become familiar with Message Queue’s implementation of the Java Message Service specification, with the components of the Message Queue service, and with the basic process of developing, deploying, and administering a Message Queue application.
This guide is designed to be read from beginning to end. The following table briefly describes the contents of each chapter.
Table P–1 Book Contents
Chapter |
Description |
---|---|
Introduces the C-API, provides quick start instructions on compiling and building Message Queue C clients. Introduces the Message Queue C-Client sample applications that are shipped with Message Queue, and explains how you set up your environment to run these examples. Provides a deployment worksheet. |
|
Explains how you use the C-API to construct, to send, to receive, and to process messages. This chapter also covers error handling, memory management, and logging. |
|
Explains the major considerations that you need to keep in mind when designing a Message Queue C client. |
|
Provides complete reference information for the Message Queue C-API: data structures and functions. It also lists and describes the contents of the C-API header files. |
|
Lists the code and descriptive string returned for errors that are returned by C library functions. |
This section describes the following conventions used in Message Queue documentation:
The following table describes the typographic conventions that are used in this book.
Table P–2 Typographic Conventions
Typeface |
Meaning |
Example |
---|---|---|
AaBbCc123 |
The names of commands, files, and directories, and onscreen computer output |
Edit your .login file. Use ls -a to list all files. machine_name% you have mail. |
AaBbCc123 |
What you type, contrasted with onscreen computer output |
machine_name% su Password: |
aabbcc123 |
Placeholder: replace with a real name or value |
The command to remove a file is rm filename. |
AaBbCc123 |
Book titles, new terms, and terms to be emphasized |
Read Chapter 6 in the User's Guide. A cache is a copy that is stored locally. Do not save the file. Note: Some emphasized items appear bold online. |
The following table explains symbols that might be used in this book.
Table P–3 Symbol Conventions
Symbol |
Description |
Example |
Meaning |
---|---|---|---|
[ ] |
Contains optional arguments and command options. |
ls [-l] |
The -l option is not required. |
{ | } |
Contains a set of choices for a required command option. |
-d {y|n} |
The -d option requires that you use either the y argument or the n argument. |
${ } |
Indicates a variable reference. |
${com.sun.javaRoot} |
References the value of the com.sun.javaRoot variable. |
- |
Joins simultaneous multiple keystrokes. |
Control-A |
Press the Control key while you press the A key. |
+ |
Joins consecutive multiple keystrokes. |
Ctrl+A+N |
Press the Control key, release it, and then press the subsequent keys. |
-> |
Indicates menu item selection in a graphical user interface. |
File -> New -> Templates |
From the File menu, choose New. From the New submenu, choose Templates. |
The following table shows the conventions used in Message Queue documentation for the default UNIX® system prompt and superuser prompt for the C shell, Bourne shell, Korn shell, and for the Windows operating system.
Table P–4 Shell PromptConventions
Shell |
Prompt |
---|---|
C shell on UNIX, Linux, or AIX |
machine-name% |
C shell superuser on UNIX, Linux, or AIX |
machine-name# |
Bourne shell and Korn shell on UNIX, Linux, or AIX |
$ |
Bourne shell and Korn shell superuser on UNIX, Linux, or AIX |
# |
Windows command line |
C:\> |
Message Queue documentation makes use of three directory variables; two of which represent environment variables needed by Message Queue. (How you set the environment variables varies from platform to platform.)
The following table describes the directory variables that might be found in this book and how they are used on the Solaris, Linux, AIX, and Windows platforms. On AIX and Windows, Message Queue is installed in a directory referred to as mqInstallHome, and some of the directory variables in Table P–5 reference this mqInstallHome directory.
In this book, directory variables are shown without platform-specific environment variable notation or syntax (such as $IMQ_HOME on UNIX). Non-platform-specific path names use UNIX directory separator (/) notation.
The information resources listed in this section provide further information about Message Queue in addition to that contained in this manual. The section covers the following resources:
The documents that comprise the Message Queue documentation set are listed in the following table in the order in which you might normally use them. These documents are available through the Sun documentation Web site at
Click “Software,” followed by “Application & Integration Services,” and then “Message Queue.”
For a content reference to topics with the Message Queue documentation set, see the Message Queue Documentation Center at the above location.
Table P–6 Message Queue Documentation Set
Document |
Audience |
Description |
---|---|---|
Developers and administrators |
Describes Message Queue concepts, features, and components. |
|
Developers and administrators |
Includes descriptions of new features, limitations, and known bugs, as well as technical notes. |
|
Developers and administrators |
Explains how to install Message Queue software on Solaris, Linux, AIX, and Windows platforms. |
|
Sun Java System Message Queue 4.3 Developer’s Guide for Java Clients |
Developers |
Provides a quick-start tutorial and programming information for developers of Java client programs using the Message Queue implementation of the JMS or SOAP/JAXM APIs. |
Administrators, also recommended for developers |
Provides background and information needed to perform administration tasks using Message Queue administration tools. |
|
Sun Java System Message Queue 4.3 Developer’s Guide for C Clients |
Developers |
Provides programming and reference documentation for developers of C client programs using the Message Queue C implementation of the JMS API (C-API). |
Sun Java System Message Queue 4.3 Developer’s Guide for JMX Clients |
Administrators |
Provides programming and reference documentation for developers of JMX client programs using the Message Queue JMX API. |
The Message Queue message service conforms to the Java Message Service (JMS) application programming interface, described in the Java Message Service Specification. This document can be found at the URL
JMS and Message Queue API documentation in JavaDoc format is included in your Message Queue installation at the locations shown in Table P–7, depending on your platform. This documentation can be viewed in any HTML browser. It includes standard JMS API documentation as well as Message Queue–specific APIs.
Table P–7 JavaDoc Locations
Message Queue provides a number of example client applications to assist developers.
Example Java client applications are located in the following directories, depending on platform. See the README files located in these directories and their subdirectories for descriptive information about the example applications.
Platform |
Location |
---|---|
Solaris |
/usr/demo/imq/ |
Linux |
/opt/sun/mq/examples |
AIX |
IMQ_HOME/examples/ [IMQ_HOME is the Message Queue home directory.] |
Windows |
IMQ_HOME\demo\ |
Example C client applications are located in the following directories, depending on platform. See the README files located in these directories and their subdirectories for descriptive information about the example applications.
Platform |
Location |
---|---|
Solaris |
/opt/SUNWimq/demo/C/ |
Linux |
/opt/sun/mq/examples/C/ |
AIX |
IMQ_HOME/examples/C/ [IMQ_HOME is the Message Queue home directory.] |
Windows |
IMQ_HOME\demo\C\ |
Example Java Management Extensions (JMX) client applications are located in the following directories, depending on platform. See the README files located in these directories and their subdirectories for descriptive information about the example applications.
Platform |
Location |
---|---|
Solaris |
/opt/SUNWimq/demo/imq/jmx |
Linux |
/opt/sun/mq/examples/jmx |
AIX |
IMQ_HOME/examples/jmx [IMQ_HOME is the Message Queue home directory.] |
Windows |
IMQ_HOME\demo\jmx |
Online help is available for the Message Queue command line utilities; for details, see Chapter 15, Command Line Reference, in Sun Java System Message Queue 4.3 Administration Guide for details. The Message Queue graphical user interface (GUI) administration tool, the Administration Console, also includes a context-sensitive help facility; see the section “Administration Console Online Help” in Chapter 2, Quick-Start Tutorial, in Sun Java System Message Queue 4.3 Administration Guide.
The Sun Web site provides information about the following additional resources:
Where relevant, this manual refers to third-party URLs that provide additional, related information.
Sun is not responsible for the availability of third-party Web sites mentioned in this manual. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by or in connection with the use of or reliance on any such content, goods, or services available on or through such sites or resources.
Besides searching Sun product documentation from the docs.sun.com web site, you can use a search engine by typing the following syntax in the search field:
search-term site:docs.sun.com |
For example, to search for “broker,” type the following:
broker site:docs.sun.com |
To include other Sun web sites in your search (for example, java.sun.com, www.sun.com, and developers.sun.com), use “sun.com” in place of “docs.sun.com” in the search field.
Sun is interested in improving its documentation and welcomes your comments and suggestions. To share your comments, go to http://docs.sun.com and click Send Comments. In the online form, provide the full document title and part number. The part number is a 7-digit or 9-digit number that can be found on the book's title page or in the document's URL. For example, the part number of this book is 819-7756.