WebSphere WebSphere Business Integration Message Service Clients for C/C++ Version 1.2.7 and .NET Version 1.2.6 Operating Systems: AIX, Linux, Solaris, Windows

MessageProducer

An application uses a message producer to send messages to a destination.

Inheritance hierarchy:
xms::PropertyContext
   |
   +----xms::MessageProducer

For a list of the XMS defined properties of a MessageProducer object, see Properties of MessageProducer.

Methods

Summary of methods:
Method Description
close Close the message producer.
getDeliveryMode Get the default delivery mode for messages sent by the message producer.
getDestination Get the destination for the message producer.
getDisableMsgID Get an indication of whether a receiving application requires message identifiers to be included in messages sent by the message producer.
getDisableMsgTS Get an indication of whether a receiving application requires time stamps to be included in messages sent by the message producer.
getHandle Get the handle that a C application would use to access the message producer.
getPriority Get the default priority for messages sent by the message producer.
getTimeToLive Get the default length of time that a message exists before it expires.
isNull Determine whether the MessageProducer object is a null object.
send 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.
send 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 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.
send 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.
setDeliveryMode Set the default delivery mode for messages sent by the message producer.
setDisableMsgID Indicate whether a receiving application requires message identifiers to be included in messages sent by the message producer.
setDisableMsgTS Indicate whether a receiving application requires time stamps to be included in messages sent by the message producer.
setPriority Set the default priority for messages sent by the message producer.
setTimeToLive Set the default length of time that a message exists before it expires.

close – Close Message Producer

Interface:
xmsVOID close();

Close the message producer.

If an application tries to close a message producer that is already closed, the call is ignored.

Parameters:
None
Returns:
Void
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getDeliveryMode – Get Default Delivery Mode

Interface:
xmsINT getDeliveryMode() const;

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:
  • XMS_X_GENERAL_EXCEPTION

getDestination – Get Destination

Interface:
Destination getDestination() const;

Get the destination for the message producer.

Parameters:
None
Returns:
The Destination object. If the message producer does not have a destination, the method returns a null Destination object.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getDisableMsgID – Get Disable Message ID Flag

Interface:
xmsBOOL getDisableMsgID() const;

Get an indication of whether a receiving application requires message identifiers to be included in messages sent by the message producer.

Parameters:
None
Returns:
  • xmsTRUE, if a receiving application does not require message identifiers to be included in messages sent by the message producer.
  • xmsFALSE, if a receiving application does require message identifiers to be included in messages sent by the message producer.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getDisableMsgTS – Get Disable Time Stamp Flag

Interface:
xmsBOOL getDisableMsgTS() const;

Get an indication of whether a receiving application requires time stamps to be included in messages sent by the message producer.

Parameters:
None
Returns:
  • xmsTRUE, if a receiving application does not require time stamps to be included in messages sent by the message producer.
  • xmsFALSE, if a receiving application does require time stamps to be included in messages sent by the message producer.
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

getHandle – Get Handle

Interface:
xmsHMsgProducer getHandle() const;

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:
  • XMS_X_GENERAL_EXCEPTION

getPriority – Get Default Priority

Interface:
xmsINT getPriority() const;

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:
  • XMS_X_GENERAL_EXCEPTION

getTimeToLive – Get Default Time to Live

Interface:
xmsLONG getTimeToLive() const;

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:
  • XMS_X_GENERAL_EXCEPTION

isNull – Check Whether Null

Interface:
xmsBOOL isNull() const;

Determine whether the MessageProducer object is a null object.

Parameters:
None
Returns:
  • xmsTRUE, if the MessageProducer object is a null object.
  • xmsFALSE, if the MessageProducer object is not a null object.
Thread context:
Any
Exceptions:
  • 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:
  • XMS_X_GENERAL_EXCEPTION
  • XMS_X_MESSAGE_FORMAT_EXCEPTION
  • XMS_X_INVALID_DESTINATION_EXCEPTION

send – Send (specifying a delivery mode, priority, and time to live)

Interface:
xmsVOID send(const Message & message,
             const xmsINT deliveryMode,
             const xmsINT priority,
             const xmsLONG timeToLive) const;

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:
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:
  • XMS_X_GENERAL_EXCEPTION
  • XMS_X_MESSAGE_FORMAT_EXCEPTION
  • XMS_X_INVALID_DESTINATION_EXCEPTION
  • XMS_X_ILLEGAL_STATE_EXCEPTION

send – Send (to a specified destination)

Interface:
xmsVOID send(const Destination & destination,
             const Message & message) const;

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:
  • XMS_X_GENERAL_EXCEPTION
  • XMS_X_MESSAGE_FORMAT_EXCEPTION
  • XMS_X_INVALID_DESTINATION_EXCEPTION

send – Send (to a specified destination, specifying a delivery mode, priority, and time to live)

Interface:
xmsVOID send(const Destination & destination,
             const Message & message,
             const xmsINT deliveryMode,
             const xmsINT priority,
             const xmsLONG timeToLive) const;

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:
  • XMS_X_GENERAL_EXCEPTION
  • XMS_X_MESSAGE_FORMAT_EXCEPTION
  • XMS_X_INVALID_DESTINATION_EXCEPTION
  • XMS_X_ILLEGAL_STATE_EXCEPTION

setDeliveryMode – Set Default Delivery Mode

Interface:
xmsVOID setDeliveryMode(const xmsINT deliveryMode);

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:
  • XMS_X_GENERAL_EXCEPTION

setDisableMsgID – Set Disable Message ID Flag

Interface:
xmsVOID setDisableMsgID(const xmsBOOL msgIDDisabled);

Indicate whether a receiving application requires message identifiers to be included in messages sent by the message producer.

On a connection to a queue manager, or on a real-time connection to a broker, this flag is ignored. On a connection to a service integration bus, the flag is honoured.

Parameters:
msgIDDisabled (input)
The value xmsTRUE means that a receiving application does not require message identifiers to be included in messages sent by the message producer. The value xmsFALSE means that a receiving application does require message identifiers. The default value is xmsFALSE.
Returns:
Void
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

setDisableMsgTS – Set Disable Time Stamp Flag

Interface:
xmsVOID setDisableMsgTS(const xmsBOOL timeStampDisabled);

Indicate whether a receiving application requires time stamps to be included in messages sent by the message producer.

On a real-time connection to a broker, this flag is ignored. On a connection to a queue manager, or on a connection to a service integration bus, the flag is honoured.

Parameters:
timeStampDisabled (input)
The value xmsTRUE means that a receiving application does not require time stamps to be included in messages sent by the message producer. The value xmsFALSE means that a receiving application does require time stamps. The default value is xmsFALSE.
Returns:
Void
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

setPriority – Set Default Priority

Interface:
xmsVOID setPriority(const xmsINT priority);

Set the default priority for messages sent by the message producer.

On a real-time connection to a broker, the priority of a message is ignored.

Parameters:
priority (input)
The default message priority. The value can be an integer in the range 0, for the lowest priority, to 9, for the highest priority. The default value is 4.
Returns:
Void
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

setTimeToLive – Set Default Time to Live

Interface:
xmsVOID setTimeToLive(const xmsLONG timeToLive);

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:
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.
Returns:
Void
Exceptions:
  • XMS_X_GENERAL_EXCEPTION

Inherited methods


Reference topic

Terms of Use | Rate this page

Last updated: 18 Jun 2008

© Copyright IBM Corporation 2005, 2008. All Rights Reserved.