Skip to content

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

License

Notifications You must be signed in to change notification settings

flutterings/simple_stomp

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages