MySQL  8.0.22
Source Code Documentation
group_replication_message_service.h File Reference
#include <mysql/components/service.h>
#include <stddef.h>

Go to the source code of this file.

Classes

struct  s_mysql_group_replication_message_service_send
 A service that sends content agnostic messages from a member to the group. More...
 
struct  s_mysql_group_replication_message_service_recv
 A service that gets called whenever an agnostic message from the group replication stream is to be delivered by the group replication receiver thread. More...
 

Typedefs

typedef struct s_mysql_group_replication_message_service_send mysql_service_group_replication_message_service_send_t
 A service that sends content agnostic messages from a member to the group. More...
 
typedef struct s_mysql_group_replication_message_service_recv mysql_service_group_replication_message_service_recv_t
 A service that gets called whenever an agnostic message from the group replication stream is to be delivered by the group replication receiver thread. More...
 

Typedef Documentation

◆ mysql_service_group_replication_message_service_recv_t

A service that gets called whenever an agnostic message from the group replication stream is to be delivered by the group replication receiver thread.

The implementation MUST NOT block the caller.

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 notified about messages received.

DEFINE_BOOL_METHOD(recv, (const char *tag, const unsigned char *data,
size_t data_length)) {
// If tag is of interest do something with data
return false;
}
group_replication_message_service_recv)
bool register_listener() {
SERVICE_TYPE(registry) *plugin_registry = mysql_plugin_registry_acquire();
plugin_registry);
using group_replication_message_service_recv_t =
SERVICE_TYPE_NO_CONST(group_replication_message_service_recv);
bool result = reg->register_service(
"group_replication_message_service_recv.listener_example",
reinterpret_cast<my_h_service>(
const_cast<group_replication_message_service_recv_t *>(
listener_example,
group_replication_message_service_recv))));