toJson method

Map<String, dynamic> toJson()

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,
  };
}