StompSessionWithKxSerialization

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

Properties

Link copied to clipboard

The Kotlinx Serialization's SerializersModule used to provide serializers at runtime.

Functions

Link copied to clipboard
abstract suspend fun abort(transactionId: String)
Link copied to clipboard
abstract suspend fun ack(ackId: String, transactionId: String?)
Link copied to clipboard
abstract suspend fun begin(transactionId: String)
Link copied to clipboard
abstract suspend fun commit(transactionId: String)
Link copied to clipboard
abstract suspend fun <T : Any> convertAndSend(headers: StompSendHeaders, body: T? = null, serializer: SerializationStrategy<T>): StompReceipt?

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

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
abstract suspend fun disconnect()
Link copied to clipboard
abstract suspend fun nack(ackId: String, transactionId: String?)
Link copied to clipboard
abstract suspend fun send(headers: StompSendHeaders, body: FrameBody?): StompReceipt?
Link copied to clipboard
abstract suspend fun subscribe(headers: StompSubscribeHeaders): Flow<StompFrame.Message>

abstract suspend fun <T : Any> subscribe(headers: StompSubscribeHeaders, 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.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
abstract suspend fun <T : Any> subscribeOptional(headers: StompSubscribeHeaders, 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.