패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.3.1

dart_amqp

AMQP 프로토콜 버전 0.9.1을 지원하는 네이티브 Dart AMQP 클라이언트입니다. 비동기 API, 플러그인식 인증 제공자 및 TLS 지원 기능을 갖추고 있습니다.

AndroidiOSmacOSWindowsLinux
30일 다운로드
7.5천
좋아요
63
Pub 점수
150

패키지 설치

flutter pub add dart_amqp

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

dart_amqp 는 AMQP 0.9.1 프로토콜용 네이티브 Dart 클라이언트로, Dart 애플리케이션에서 실시간 통신을 가능하게 합니다. 효율적인 메시지 처리를 위한 비동기 API를 제공하며, 안전한 연결을 위한 TLS 암호화를 지원하고, 플러그인형 인증 메커니즘을 허용합니다. RabbitMQ와 같은 메시지 브로커와의 통합에 적합하며, 다양한 플랫폼 간 신뢰성 있고 낮은 지연 시간의 메시징을 가능하게 합니다.

사용 사례

  • 실시간 메시징 시스템
  • 사물인터넷 장치 통신
  • 이벤트 기반 백엔드 서비스
  • 라이브 스트리밍 데이터 파이프라인
  • 마이크로서비스 조정

주요 기능

  • AMQP 0.9.1 프로토콜 지원
  • 비동기 API 설계
  • TLS 암호화
  • 플러그인 가능 인증
  • 크로스 플랫폼 호환성

적합한 대상

  • 실시간 앱을 개발하는 개발자
  • RabbitMQ를 사용하는 팀
  • 안전한 메시징이 필요한 응용 프로그램
  • 이벤트 라우팅이 필요한 백엔드 서비스
  • 다중 플랫폼 Dart 프로젝트

고려 사항

  • AMQP 브로커(예: RabbitMQ)가 필요합니다
  • AMQP 0.9.1로 제한됨
  • 인증 설정이 필요합니다
  • 실시간이 아닌 사용 사례에는 적합하지 않습니다
  • 내장 메시지 지속성 없음

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

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.

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트