Package-level declarations

Types

Link copied to clipboard

A StompSession with additional methods to serialize/deserialize message bodies using Kotlinx Serialization.

Functions

Link copied to clipboard
inline suspend fun <T : Any> StompSessionWithKxSerialization.convertAndSend(destination: String, body: T? = null): StompReceipt?

Sends a SEND frame to the given destination with the given body, converted appropriately.

inline suspend fun <T : Any> StompSessionWithKxSerialization.convertAndSend(headers: StompSendHeaders, body: T? = null): StompReceipt?

Sends a SEND frame to the server with the given headers and the given body, converted appropriately.

suspend fun <T : Any> StompSessionWithKxSerialization.convertAndSend(destination: String, body: T? = null, serializer: SerializationStrategy<T>): StompReceipt?

Sends a SEND frame to the given destination with the given body, converted appropriately using the provided serializer.

Link copied to clipboard
inline suspend fun <T : Any> StompSessionWithKxSerialization.subscribe(destination: String): Flow<T>
suspend fun <T : Any> StompSessionWithKxSerialization.subscribe(destination: String, deserializer: DeserializationStrategy<T>): Flow<T>

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.

Link copied to clipboard
inline suspend fun <T : Any> StompSessionWithKxSerialization.subscribeOptional(destination: String): Flow<T?>
suspend fun <T : Any> StompSessionWithKxSerialization.subscribeOptional(destination: String, deserializer: DeserializationStrategy<T>): Flow<T?>

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.

Link copied to clipboard

Wraps this StompSession to add methods that can convert message bodies using the provided Kotlinx Serialization's BinaryFormat.

Link copied to clipboard

Wraps this StompSession to add methods that can convert message bodies using the provided Kotlinx Serialization's StringFormat.