subscribe
abstract suspend fun <T : Any> subscribe(headers: StompSubscribeHeaders, deserializer: DeserializationStrategy<T>): Flow<T>(source)
Subscribes and returns a Flow of messages of type T that unsubscribes automatically when the collector is done or cancelled. The returned flow can be collected only once.
The received MESSAGE frames are converted into instances of T using the provided Kotlinx Serialization's deserializer. Message frames without a body are not allowed and result in an exception in the flow's collector.
See the general StompSession documentation for more details about subscription flows and receipts.