MySQL 8.4.0
Source Code Documentation
s_mysql_group_replication_message_service_send Struct Reference

A service that sends content agnostic messages from a member to the group. More...

#include <group_replication_message_service.h>

Public Attributes

mysql_service_status_t(* send )(const char *tag, const unsigned char *payload, const size_t payload_length)
 This function SHALL be called whenever the caller wants to send an agnostic messages to the group replication stream. More...
 

Detailed Description

A service that sends content agnostic messages from a member to the group.

This only works if the component is on a server with group replication running and the member state is ONLINE. If server isn't ONLINE message won't be deliver.

After message sent to all members of the group, all components that have registered group_replication_message_service_recv service will be notified.

SERVICE_TYPE(registry) *plugin_registry = mysql_plugin_registry_acquire();
my_service<SERVICE_TYPE(group_replication_message_service_send)> svc(
"group_replication_message_service_send", plugin_registry);
if (svc.is_valid()) {
bool error = svc->send("tag", "payload", sizeof("payload"));
}
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:35
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76
const mysql_service_registry_t * mysql_plugin_registry_acquire()
Returns a new reference to the "registry" service.
Definition: plugin_registry_service.cc:47

Member Data Documentation

◆ send

mysql_service_status_t(* s_mysql_group_replication_message_service_send::send) (const char *tag, const unsigned char *payload, const size_t payload_length)

This function SHALL be called whenever the caller wants to send an agnostic messages to the group replication stream.

Parameters
[in]tagtag identifies message
[in]payloaddata to be deliver
[in]payload_lengthsize of data
Returns
false success, true on failure. Failure can happen if Group Replication status isn't ONLINE or RECOVERING or a communication failure occurs.

The documentation for this struct was generated from the following file: