sendMessage method
Sends a message to a destination on a specific peer
Implementation
Future<String?> sendMessage({
required PeerId peerId,
required String destination,
String? body,
String? contentType,
bool requestReceipt = false,
Map<String, String>? headers,
}) async {
final client = _clients[peerId];
if (client == null || !client.isConnected) {
throw StompConnectionException('No active connection to peer $peerId');
}
return await client.send(
destination: destination,
body: body,
contentType: contentType,
requestReceipt: requestReceipt,
headers: headers,
);
}