libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
bmqa_message.h File Reference

Provide the application with a message data object. More...

#include <bmqa_queueid.h>
#include <bmqt_compressionalgorithmtype.h>
#include <bmqt_correlationid.h>
#include <bmqt_messageguid.h>
#include <bmqt_subscription.h>
#include <bdlbb_blob.h>
#include <bsl_cstddef.h>
#include <bsl_iosfwd.h>
#include <bsl_memory.h>
#include <bsl_string.h>
#include <bslma_allocator.h>
#include <bsls_annotation.h>

Go to the source code of this file.

Classes

class  BloombergLP::bmqa::MessageConfirmationCookie
 Cookie for async message confirmation. More...
 
class  BloombergLP::bmqa::Message
 A message sent/received to/from the BlazingMQ broker. More...
 

Namespaces

 BloombergLP
 
 BloombergLP::bmqa
 

Functions

bsl::ostream & BloombergLP::bmqa::operator<< (bsl::ostream &stream, const Message &rhs)
 

Detailed Description

A bmqa::Message represents the data message to put on a queue, or retrieved from a queue. It is composed of the following fields:

  • A message GUID, which is a printable string generated by the broker to uniquely identify this message.
  • A correlation Id, which is a user-provided identifier for the message.
  • A queue Id, to map with the queue this message is associated with.
  • The payload, which is opaque to the framework. At some point, framework may provide utilities to encode and decode schema messages using various CODECs. For example, a JavaScript publisher may publish a message into a queue using a JSON object as payload, and the consumer may be receiving that payload as a BER-encoded schema object.
  • At some point, system properties such as version, encoding, timestamp, priority, message group and "reply-to" will be supported. System properties will be used by the broker; for example to deliver high-priority messages first or to filter based on a minimum version.
  • At some point, application-defined message properties will also be supported, where properties are a list of name-value pairs.

A bmqa::MessageConfirmationCookie is a small object which allows to confirm a bmqa::Message asynchronously without having to hold on to the entire message. This can be useful when, for example, the message is decoded in the event handler, and the resulting object is enqueued for asynchronous processing, along with that small cookie object for confirming the message once successfully processed.

See also
bmqa::MessageEvent: Mechanism for data event notification.
bmqa::MessageEventBuilder: Builder for bmqa::MessageEvent.