https://github.com/fpseverino/stomp-nio
A Swift NIO STOMP Client
https://github.com/fpseverino/stomp-nio
server-side-swift stomp stomp-client swift swift-nio
Last synced: 6 months ago
JSON representation
A Swift NIO STOMP Client
- Host: GitHub
- URL: https://github.com/fpseverino/stomp-nio
- Owner: fpseverino
- License: mit
- Created: 2025-11-10T15:42:04.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-12-02T22:17:00.000Z (6 months ago)
- Last Synced: 2025-12-02T23:23:42.447Z (6 months ago)
- Topics: server-side-swift, stomp, stomp-client, swift, swift-nio
- Language: Swift
- Homepage: https://swiftpackageindex.com/fpseverino/stomp-nio/documentation
- Size: 40 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Notice: Notice.txt
Awesome Lists containing this project
README
# STOMP NIO
[](https://swiftpackageindex.com/fpseverino/stomp-nio)
[](https://swiftpackageindex.com/fpseverino/stomp-nio)


A Swift NIO based STOMP v1.0, v1.1 and v1.2 client.
> Heavily inspired by [Adam Fowler](https://github.com/adam-fowler)'s work on [MQTT NIO](https://github.com/swift-server-community/mqtt-nio) and [valkey-swift](https://github.com/valkey-io/valkey-swift).
**Simple (or Streaming) Text Oriented Message Protocol** ([**STOMP**](https://stomp.github.io)) is a simple interoperable protocol designed for asynchronous message passing between clients via mediating servers.
It defines a text based wire-format for messages passed between these clients and servers.
STOMP has been in active use for several years and is supported by many message brokers and client libraries.
STOMPNIO is a Swift NIO based implementation of a STOMP client. It supports:
- [x] STOMP versions 1.0, 1.1, and 1.2
- [ ] Unencrypted and encrypted (via TLS) connections
- [ ] WebSocket connections
- [x] POSIX sockets
- [x] Apple's Network framework via [NIOTransportServices](https://github.com/apple/swift-nio-transport-services) (required for iOS)
- [x] Unix domain sockets
## Overview
You can create a connection to a STOMP broker and send and receive messages from it using `STOMPConnection.withConnection`.
```swift
try await STOMPConnection.withConnection(address: .hostname("localhost"), logger: logger) { connection in
try await connection.send(ByteBuffer(string: "Hello, STOMP over NIO!"), to: "/queue/a")
}
```
```swift
try await STOMPConnection.withConnection(address: .hostname("localhost"), logger: logger) { connection in
try await connection.subscribe(to: "/queue/a") { subscription in
for try await frame in subscription {
print(String(buffer: frame.body))
}
}
}
```
## Documentation
User guides and reference documentation for STOMP NIO can be found on the [Swift Package Index](https://swiftpackageindex.com/fpseverino/stomp-nio/documentation).