Skip to content
/ Kowet Public

implements STOMP protocol by websocket for KMM (WIP)

Notifications You must be signed in to change notification settings

ColaGom/Kowet

Repository files navigation

Kowet

Maven Central

KMM WebSocket support to STOMP protocol

STOMP?

Usage

Android

val ws = WebSocketFactory.create("ws://10.0.2.2:8081/connect/websocket")
// create session
val session = Stomp.over(
    ws,
    scope = lifecycleScope
)

// subscribe topic
session.subscribe("topic", "1")

session.events.onEach {
    //TODO: handle event
}.launchIn(lifecycleScope)

iOS

let ws = WebSocketFactory_.shared.create(url: "ws://localhost:8081/connect/websocket")
//create session
let wrapper = SocketHelperKt.stomp(webSocket: ws)

//subscribe topic
wrapper.subscribe(destination: "topic")

wrapper.watch { event in
    // handle event
}

Release

Groovy DSL

implementation 'io.github.colagom:kowet:{version}'

Kotlin DSL

implementation("io.github.colagom:kowet:{version}")