toJson method
Converts the message to a JSON representation.
Implementation
Map<String, dynamic> toJson() {
return {
'id': id,
'type': type,
'data': data,
'timestamp': timestamp.toIso8601String(),
'requiresAck': requiresAck,
'retryCount': retryCount,
'maxRetries': maxRetries,
};
}