simple_stomp 0.0.1 copy "simple_stomp: ^0.0.1" to clipboard
simple_stomp: ^0.0.1 copied to clipboard

This is a pure dart Stomp v1.2 client implementation for connecting to a Message Brocker.

simple_stomp #

A Dart client library for STOMP messaging protocol.

Usage #

A simple usage example:

import 'package:simple_stomp/simple_stomp.dart';

Future<void> main() async {
  final stompClient = StompClient(
    config: StompClientOptions(
      host: 'localhost',
      port: 61613,
      login: 'guest',
      passcode: 'guest',
      heartbeat: const Duration(seconds: 5),
      timeout: const Duration(seconds: 5),
    ),
  );

  await stompClient.connect();
}

Subscribe to a destination:

stompClient.subscribe(
  destination: '/topic/foo',
  callback: (frame) {
    print('Received: ${frame.body}');
  },
);

Unsubscribe from a destination:

stompClient.unsubscribe('/topic/foo');

Send a message to a destination:

stompClient.send(
  '/topic/foo',
  'Hello, World!',
);

Disconnect from the server:

stompClient.disconnect();

Roadmap #

Take a look at the tracking project for Stomp v1.2 implementation: Stomp v1.2 feature complete

Features and bugs #

Please file feature requests and bugs at the issue tracker.

License #

This project is licensed under the MIT License - see the LICENSE file for details.

1
likes
135
points
110
downloads

Publisher

verified publisherflutterings.dev

Weekly Downloads

This is a pure dart Stomp v1.2 client implementation for connecting to a Message Brocker.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on simple_stomp