ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Attributes | List of all members
message Struct Reference

A received NATS message. More...

#include <message.hpp>

Collaboration diagram for message:
Collaboration graph

Public Attributes

std::string subject
 The subject the message was published to.
 
std::string reply_subject
 The reply-to subject, empty for one-way publishes.
 
std::vector< std::byte > data
 The message payload bytes.
 
std::unordered_map< std::string, std::string > headers
 NATS message headers (NATS 2.2+).
 

Detailed Description

A received NATS message.

No cnats types appear here. All data is copied out of the cnats message before the callback returns so the cnats message can be destroyed immediately on the cnats internal thread.

Member Data Documentation

◆ reply_subject

std::string reply_subject

The reply-to subject, empty for one-way publishes.

Services write their response to this subject.

◆ data

std::vector<std::byte> data

The message payload bytes.

Typically a MessagePack-encoded domain struct.

◆ headers

std::unordered_map<std::string, std::string> headers

NATS message headers (NATS 2.2+).

The Authorization header carries the JWT bearer token for per-request authentication: "Authorization" -> "Bearer <token>".