Pakete, Repositories und App-Kategorien suchen

Paketdetailsv0.3.1

dart_amqp

Ein natives Dart-AMQP-Client, das Version 0.9.1 des AMQP-Protokolls unterstützt. Es verfügt über eine asynchrone API, pluggbare Authentifizierungsanbieter und TLS-Unterstützung.

AndroidiOSmacOSWindowsLinux
30-Tage-Downloads
7500
Likes
63
Pub-Punkte
150

Paket installieren

flutter pub add dart_amqp

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

dart_amqp ist ein natives Dart-Client für das AMQP-Protokoll 0.9.1, das Echtzeitkommunikation in Dart-Anwendungen ermöglicht. Es bietet eine asynchrone API zur effizienten Nachrichtenverarbeitung, unterstützt TLS-Verschlüsselung für sichere Verbindungen und erlaubt pluggable Authentifizierungsmechanismen. Ideal für die Integration mit Message-Brokern wie RabbitMQ, ermöglicht es zuverlässige, latenzarme Nachrichtenkommunikation über Plattformen hinweg.

Anwendungsfälle

  • Echtzeit-Messaging-Systeme
  • IoT-Gerätekommunikation
  • ereignisgesteuerte Backend-Dienste
  • Live-Streaming-Datenpipelines
  • Koordinierung von Microservices

Hauptmerkmale

  • AMQP 0.9.1-Protokollunterstützung
  • Asynchrone API-Entwicklung
  • TLS-Verschlüsselung
  • Plug-in-Authentifizierung
  • Plattformübergreifende Kompatibilität

Geeignet für

  • Entwickler, die Echtzeit-Apps erstellen
  • Teams, die RabbitMQ verwenden
  • Anwendungen, die sichere Nachrichtenübermittlung erfordern
  • Backend-Dienste, die Ereignisweiterleitung benötigen
  • Multiplattform-Dart-Projekte

Hinweise

  • Benötigt AMQP-Broker (z. B. RabbitMQ)
  • Beschränkt auf AMQP 0.9.1
  • Authentifizierungseinstellung erforderlich
  • Nicht geeignet für nicht-zeitkritische Anwendungsfälle
  • Keine integrierte Nachrichtenpersistenz

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

dart_amqp

Build Status Coverage Status

Dart AMQP client implementing protocol version 0.9.1

Main features:

  • asynchronous API based on Futures and Streams
  • supports PLAIN and AMQPLAIN authentication providers while other authentication schemes can be plugged in by implementing the appropriate interface.
  • implements the entire 0.9.1 protocol specification (except basic get and recover-async).
  • supports both plain-text and TLS connections.
  • supports publish confirmations.
  • supports heartbeats.

Things not working yet:

  • the driver does not currently support recovering client topologies when re-establishing connections. This feature may be implemented in a future version.

Quick start

Listening to a queue:

import "package:dart_amqp/dart_amqp.dart";

void main() async {
  Client client = Client();

  Channel channel = await client.channel(); // auto-connect to localhost:5672 using guest credentials
  Queue queue = await channel.queue("hello");
  Consumer consumer = await queue.consume();
  consumer.listen((AmqpMessage message) {
    // Get the payload as a string
    print(" [x] Received string: ${message.payloadAsString}");

    // Or unserialize to json
    print(" [x] Received json: ${message.payloadAsJson}");

    // Or just get the raw data as a Uint8List
    print(" [x] Received raw: ${message.payload}");

    // The message object contains helper methods for
    // replying, ack-ing and rejecting
    message.reply("world");
  });
}

Sending messages via an exchange:

import "package:dart_amqp/dart_amqp.dart";

void main() async {

  // You can provide a settings object to override the
  // default connection settings
  ConnectionSettings settings = ConnectionSettings(
    host: "remote.amqp.server.com",
    authProvider: PlainAuthenticator("user", "pass")
  );
  Client client = Client(settings: settings);

  Channel channel = await client.channel();
  Exchange exchange = await channel.exchange("logs", ExchangeType.FANOUT);
  // We dont care about the routing key as our exchange type is FANOUT
  exchange.publish("Testing 1-2-3", null);
  client.close();
}

API

See the API documentation.

RPC calls over AMQP

This example illustrates how to get a basic RPC server/client up and running using just the provided api calls.

The driver does not provide any helper classes for easily performing RPC calls over AMQP as not everyone needs this functionality. If you need RPC support for your application you may want to consider using the dart_amqp_rpc package.

Examples

The example folder contains implementations of the six RabbitMQ getting started tutorials.

Contributing

See the Contributing Guide.

License

dart_amqp is distributed under the MIT license.

Kategorien

Abhängigkeiten

Abhängigkeiten 2 Einträge

Quell-Repository

Projekte, die dieses Paket verwenden