close method
Closes component and frees used resources.
correlationId
(optional) transaction id to trace execution through call chain.
Implementation
@override
Future close(String? correlationId) async {
if (!isOpen()) {
return Future.value(null);
}
try {
// Unsubscribe from the broker
await unsubscribe(correlationId);
} finally {
_messages = [];
_receiver = null;
}
}