This chapter contains an overview of CRTL specific data types and constants.
CRTL Data Types
The CRTL specific data types are defined in the mq_datatypes.h file. This is done in order to make the communication format of the C client compliant with the Java based FioranoMQ server.
The most common data types used in CRTL are mqbyte, mqchar, mqshort, mqint, mqlong, mqfloat, mqdouble, mqstring, and mqbyteArray.
It is necessary to use these data types when programming with CRTL because of the difference in sizes of the corresponding data types in Java. The sizes of these data types are specified in the following table:
Data Type | Size |
mqbyte | 8 bits (unsigned) |
mqchar | 8 bits |
mqshort | 16 bits |
mqint | 32 bits |
mqlong | 64 bits |
mqfloat | 32 bits |
mqdouble | 64 bits |
TABLE 2-1 Size of Data Types
The mqstring and mqbyteArray are defined as pointers to mqchar and mqbyte, respectively.
Apart from these basic data types, there is another important data type defined in CRTL "mqobject". It is defined to be (void *). Certain functions, which can return different types of objects, returns an mqobject and it is the responsibility of the user to use the object in a suitable manne
It is also recommended to type cast the mqobject into an appropriate type, before using it.
The mqchar is defined to occupy only 8 bits and not 16 bits (as in Java), so that it is convenient to manage it in the user code. h1.CRTL Constants
All the important public macros that are used in the CRTL are defined in the following header files:
1.initial_context.h
2.common_def.h
It is recommended to use these constants instead of using the corresponding values to avoid any complexities.
Lookup Related Constants
Following are the permissible variable names and values in the InitialContext environment. This environment is used to create a new InitialContext, which in turn is used for looking up administered object from the FioranoMQ server.
Permissible names for the required variables:
- Username for accessing the admin store
#define SECURITY_PRINCIPAL "SECURITY_PRINCIPAL"
- Password for the above mentioned username
#define SECURITY_CREDENTIALS "SECURITY_CREDENTIALS"
- URL or location of the admin store (FioranoMQ server in this case)
#define PROVIDER_URL "PROVIDER_URL"
- Protocol over which the C clients would communicate with the FioranoMQ server
#define TRANSPORT_PROTOCOL "TRANSPORT_PROTOCOL"
Following are the permissible values for Transport protocol:l
- #define TCP_PROTOCOL "TCP"
- #define HTTP_PROTOCOL "HTTP"
- #define SSL_PROTOCOL "SSL"
- #define HTTPS_PROTOCOL "HTTPS"
Following are the names of different variables that are used for client-server communication over HTTP protocol:
- URL of the HTTP proxy server through which the HTTP connections have to be routed
#define HTTP_PROXY_URL "HTTP_PROXY_URL"
- The type of HTTP Proxy server being used between FioranoMQ client and server
#define HTTP_PROXY_TYPE "HTTP_PROXY_TYPE"
- The authentication realms (if any) being used on the HTTP proxy server
#define PROXY_AUTHENTICATION_REALM "PROXY_AUTHENTICATION_REALM"
- Username to pass through the HTTP Proxy server
#define PROXY_PRINCIPAL "PROXY_PRINCIPAL"
- Password for the above mentioned username
#define PROXY_CREDENTIALS "PROXY_CREDENTIALS
- Variable for forcing HTTP 1.0 connections
#defineFORCE_HTTP_10 "FORCE_HTTP_10"
Following are names of different variables that are required for FioranoMQ client-server communication over SSL protocol:
- Fully qualified path with name of the SSL certificate file
#define SSL_CERT_FILE "SSL_CERT_FILE"
- Fully qualified path with name of the SSL private key file
#define SSL_PRIVATE_KEY_FILE "SSL_PRIVATE_KEY_FILE"
- Password for the SSL private key
#define SSL_PRIVATE_KEY_PASSWORD "
SSL_PRIVATE_KEY_PASSWORD"
Messaging Related Constants
Messaging related constants are required while creating sessions and sending messages to a queue or topic on the FioranoMQ server.
Following are the possible values of the acknowledgement mode that can be used while creating a TopicSession or a QueueSession:
- #define AUTO_ACKNOWLEDGE 1
- #define CLIENT_ACKNOWLEDGE 2
- #define DUPS_OK_ACKNOWLEDGE 3
Following are the permissible values for the message delivery mode that can be used in publish or send call. The persistence of a message is decided using these constants:
- #define NON_PERSISTENT 1
- #define PERSISTENT 2
Following are the string representations of the various message types that can be sent by a C client to the FioranoMQ server. A call of Msg_getJMSType returns one of these values:
- #define JMSMESSAGE "Message"
- #define BYTESMESSAGE "BytesMessage"
- #define STREAMMESSAGE "StreamMessage"
- #define MAPMESSAGE "MapMessage"
- #define TEXTMESSAGE "TextMessage"
Following are some of the permissible values for message priority that can be used in publish or send call:
- #define MinPriority 0
- #define MaxPriority 9
- #define LowPriority 0
- #define NormPriority 4
- #define HighPriority 9