Skip Headers
Oracle® C++ Call Interface Programmer's Guide,
11g Release 2 (11.2)

Part Number E10764-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub
LNCPP1026

Message Class

A message is the unit that is enqueued dequeued. A Message object holds both its content, or payload, and its properties. This class provides methods to get and set message properties.

LNCPP21127Table 13-25 Enumerated Values Used by Message Class

Attribute Options
MessageState
  • MSG_WAITING indicates that the message delay time has not been reached

  • MSG_READY indicates that the message is ready to be processed

  • MSG_PROCESSED indicates that the message has been processed, and is being retained

  • MSG_EXPIRED indicates that the message has been moved to the exception queue.

PayloadType
  • RAW

  • ANYDATA

  • OBJECT


LNCPP21128Table 13-26 Summary of Message Methods

Method Summary

Message()

Message class constructor.

getAnyData()

Retrieves AnyData payload of the message.

getAttemptsToDequeue()

Retrieves the number of attempts made to dequeue the message.

getBytes()

Retrieves Bytes payload of the message.

getCorrelationId()

Retrieves the identification string.

getDelay()

Retrieves delay with which message was enqueued.

getExceptionQueueName()

Retrieves name of queue to which Message is moved when it cannot be processed.

getExpiration()

Retrieves the expiration of the message.

getMessageEnqueuedTime()

Retrieves time at which message was enqueued.

getMessageState()

Retrieves state of the message at time of enqueuing.

getObject()

Retrieves object payload of the message.

getOriginalMessageId()

Retrieves the Id of the message that generated this message on the last queue.

getPayloadType()

Retrieves the type of the payload.

getPriority()

Retrieves the priority of the message.

getSenderId()

Retrieves the agent who send the Message.

isNull()

Tests whether the Message object is NULL.

operator=()

Assignment operator for Message.

setAnyData()

Specifies AnyData payload of the message.

setBytes()

Specifies Bytes payload of the message.

setCorrelationId()

Specifies the identification string.

setDelay()

Specifies the number of seconds to delay the enqueued Message.

setExceptionQueueName()

Specifies the name of the queue to which the Message object is moved if it cannot be precessed.

setExpiration()

Specifies the duration of time that Message can be dequeued before it expires.

setNull()

Sets the Message object to NULL.

setObject()

Specifies object payload of the message.

setOriginalMessageId()

Specifies id of last queue that generated the Message.

setPriority()

Specifies priority of the Message object.

setRecipientList()

Specifies the list of agents for whom the message is intended.

setSenderId()

Specifies the sender of the Message.


LNCPP21129

Message()

Message class constructor.

Syntax Description
Message(
    const Environment *env);
Creates a Message object within the specified Environment.
Message(
   const Message& mes);
Copy constructor.

Parameter Description
env
The environment of the Message.
mes
The original Message.

LNCPP21130

getAnyData()

Retrieves the AnyData payload of the Message.

LNCPP21131Syntax

AnyData getAnyData() const;
LNCPP21132

getAttemptsToDequeue()

Retrieves the number of attempts made to dequeue the message. This property cannot be retrieved while enqueuing.

LNCPP21133Syntax

int getAttemptsToDequeue() const;
LNCPP21134

getBytes()

Retrieves Bytes payload of the Message.

LNCPP21135Syntax

Bytes getBytes() const;
LNCPP21136

getCorrelationId()

Retrieves the identification string.

LNCPP21137Syntax

string getCorrelationId() const;
LNCPP21138

getDelay()

Retrieves the delay (in seconds) with which the Message was enqueued.

LNCPP21139Syntax

int getDelay() const;
LNCPP21140

getExceptionQueueName()

Retrieves the name of the queue to which the Message is moved, in cases when the Message cannot be processed successfully.

LNCPP21141Syntax

string getExceptionQueueName() const;
LNCPP21142

getExpiration()

Retrieves the expiration time of the Message (in seconds). This is the duration for which the message is available for dequeuing.

LNCPP21143Syntax

int getExpiration() const;
LNCPP21144

getMessageEnqueuedTime()

Retrieves the time at which the message was enqueued, in Date format. This value is determined by the system, and cannot be set by the user.

LNCPP21145Syntax

Date getMessageEnqueuedTime() const;
LNCPP21146

getMessageState()

Retrieves the state of the message at the time of enqueuing. This parameter cannot be set an enqueuing time. MessageState is defined in Table 13-25.

LNCPP21147Syntax

MessageState getMessageState() const;
LNCPP21148

getObject()

Retrieves object payload of the Message.

LNCPP21149Syntax

PObject* getObject();
LNCPP21150

getOriginalMessageId()

Retrieves the original message Id. When a message is propagated from one queue to another, gets the ID to the last queue that generated this message.

LNCPP21151Syntax

Bytes getOriginalMessageId() const;
LNCPP21152

getPayloadType()

Retrieves the type of the payload, as defined for PayloadType in Table 13-25.

LNCPP21153Syntax

PayloadType getPayloadType( ) const;
LNCPP21154

getPriority()

Retrieves the priority of the Message.

LNCPP21155Syntax

int getPriority() const;
LNCPP21156

getSenderId()

Retrieves the agent who send the Message.

LNCPP21157Syntax

Agent getSenderId() const;
LNCPP21158

isNull()

Tests whether the Message object is NULL. If the Message object is NULL, then TRUE is returned; otherwise, FALSE is returned.

LNCPP21159Syntax

bool isNull() const;
LNCPP21160

operator=()

Assignment operator for Message.

void operator=(
   const Message& mes);
Parameter Description
mes
Original message.

LNCPP21161

setAnyData()

Specifies AnyData payload of the Message.

LNCPP21162Syntax

void setAnyData(
   const AnyData& anydata);
Parameter Description
anydata
Data content of the Message.

LNCPP21163

setBytes()

Specifies Bytes payload of the Message.

LNCPP21164Syntax

void setBytes(
   const Bytes& bytes);
Parameter Description
bytes
Data content of the Message.

LNCPP21165

setCorrelationId()

Specifies the identification string. This parameter is set at enqueuing time by the Producer. Messages can be dequeued with this id. The id can contain wildcard characters.

LNCPP21166Syntax

void setCorrelationId(
   const string& id);
Parameter Description
id
The id; upper limit of 128 bytes.

LNCPP21167

setDelay()

Specifies the time (in seconds) to delay the enqueued Message. After the delay ends, the Message is available for dequeuing.

Note that dequeuing by msgid overrides the delay specification. A Message enqueued with delay is in the WAITING state. Delay is set by the producer of the Message.

LNCPP21168Syntax

void setDelay(
   int delay);
Parameter Description
delay
The delay.

LNCPP21169

setExceptionQueueName()

Specifies the name of the queue to which the Message object is moved if it cannot be processed successfully. The queue name must be valid.

Note that if the exception queue does not exist at the time of the move, the Message is moved to the default exception queue associated with the queue table; a warning is logged in the alert log.

Also note that if the default exception queue is used, the parameter returns a NULL value at enqueuing time; the attribute must refer to a valid queue name.

LNCPP21170Syntax

void setExceptionQueueName(
   const string& queue);
Parameter Description
queue
The name of the exception queue.

LNCPP21171

setExpiration()

Specifies the duration time (in seconds) that the Message object is available for dequeuing. A Message expires after this time.

LNCPP21172Syntax

void setExpiration(
   int exp);
Parameter Description
exp
The duration of expiration.

LNCPP21173

setNull()

Sets the Message object to NULL. Before the Connection is destroyed by the terminateConnection() call of the Environment Class, all Message objects must be set to NULL.

LNCPP21174Syntax

void setNull();
LNCPP21175

setObject()

Specifies object payload of the Message.

LNCPP21176Syntax

void setObject(
   PObject& pobj);
Parameter Description
pobj
Content of the data

LNCPP21177

setOriginalMessageId()

Sets the Id of the last queue that generated the message, when a message is propagated from one queue to another.

LNCPP21178Syntax

void setOriginalMessageId(
   const Bytes& queue);
Parameter Description
queue
The last queue.

LNCPP21179

setPriority()

Specifies the priority of the Message object. This property is set during enqueuing time, and can be negative. Default is 0.

LNCPP21180Syntax

void setPriority(
   int priority);
Parameter Description
priority
The priority of the Message.

LNCPP21181

setRecipientList()

Specifies the list of Agents for whom the Message is intended. These recipients are not identical to subscribers of the queue. The property is set during enqueuing. All Agents in the list must be valid. The recipient list overrides the default subscriber list.

LNCPP21182Syntax

void setRecipientList(
   vector<Agent>& agentList);
Parameter Description
agentList
The list of Agents.

LNCPP21183

setSenderId()

Specifies the sender of the Message.

LNCPP21184Syntax

void setSenderId(
   const Agent& sender);
Parameter Description
sender
Sender id.

Reader Comment

   

Comments, corrections, and suggestions are forwarded to authors every week. By submitting, you confirm you agree to the terms and conditions. Use the OTN forums for product questions. For support or consulting, file a service request through My Oracle Support.

Hide Navigation

Quick Lookup

Database Library · Master Index · Master Glossary · Book List · Data Dictionary · SQL Keywords · Initialization Parameters · Advanced Search · Error Messages

Main Categories

This Page

This Document

New and changed documents:
RSS Feed HTML RSS Feed PDF