All Projects → vcabbage → Amqp

vcabbage / Amqp

Licence: mit
AMQP 1.0 client library for Go.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Amqp

Curl
A command line tool and library for transferring data with URL syntax, supporting DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET and TFTP. libcurl offers a myriad of powerful features
Stars: ✭ 22,875 (+16844.44%)
Mutual labels:  library, client
Gitter Api
[production-ready] Gitter API implementation for php 7.0+ allowing sync, async and streaming access.
Stars: ✭ 11 (-91.85%)
Mutual labels:  library, client
Pycraft
Minecraft-client networking library in Python
Stars: ✭ 574 (+325.19%)
Mutual labels:  library, client
Simplenetwork
simple TCP server / client C++ linux socket
Stars: ✭ 225 (+66.67%)
Mutual labels:  library, client
Gowebdav
A golang WebDAV client library and command line tool.
Stars: ✭ 97 (-28.15%)
Mutual labels:  library, client
Mtproto Core
Telegram API JS (MTProto) client library for browser and nodejs
Stars: ✭ 242 (+79.26%)
Mutual labels:  library, client
M2x Python
AT&T M2X Python Library
Stars: ✭ 25 (-81.48%)
Mutual labels:  library, client
Simple Web Server
A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
Stars: ✭ 2,261 (+1574.81%)
Mutual labels:  library, client
Cocsharp
Clash of Clans library, proxy and server written in .NET [Unmaintained]
Stars: ✭ 94 (-30.37%)
Mutual labels:  library, client
Graphql client
GraphQL Client.
Stars: ✭ 78 (-42.22%)
Mutual labels:  library, client
Pyrogram
Telegram MTProto API Client Library and Framework in Pure Python for Users and Bots
Stars: ✭ 2,252 (+1568.15%)
Mutual labels:  library, client
Freeradius Client
A BSD licenced RADIUS client library
Stars: ✭ 103 (-23.7%)
Mutual labels:  library, client
Beanstalk
Minimalistic PHP client for beanstalkd without any dependencies
Stars: ✭ 199 (+47.41%)
Mutual labels:  library, client
Libmqtt
MQTT v3.1.1/5.0 library in Go
Stars: ✭ 290 (+114.81%)
Mutual labels:  library, client
Sdk
Library for using Grafana' structures in Go programs and client for Grafana REST API.
Stars: ✭ 193 (+42.96%)
Mutual labels:  library, client
Simple Websocket Server
A very simple, fast, multithreaded, platform independent WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11, Boost.Asio and OpenSSL. Created to be an easy way to make WebSocket endpoints in C++.
Stars: ✭ 685 (+407.41%)
Mutual labels:  library, client
Bt
BitTorrent library and client with DHT, magnet links, encryption and more
Stars: ✭ 2,011 (+1389.63%)
Mutual labels:  library, client
Librabbitmq
Python bindings to librabbitmq-c
Stars: ✭ 181 (+34.07%)
Mutual labels:  library, amqp
Adrestia
APIs & SDK for interacting with Cardano.
Stars: ✭ 56 (-58.52%)
Mutual labels:  library, client
Ts3admin.class
The ts3admin.class is a powerful api for communication with Teamspeak 3 Servers from your website! Your creativity knows no bounds!
Stars: ✭ 103 (-23.7%)
Mutual labels:  library, client

pack.ag/amqp

Go Report Card Coverage Status Build Status GoDoc MIT licensed

pack.ag/amqp is an AMQP 1.0 client implementation for Go.

NOTE: This project is no longer under active development. See issue #205 for details.

AMQP 1.0 is not compatible with AMQP 0-9-1 or 0-10, which are the most common AMQP protocols in use today. A list of AMQP 1.0 brokers and other AMQP 1.0 resources can be found at github.com/xinchen10/awesome-amqp.

This library aims to be stable and worthy of production usage, but the API is still subject to change. To conform with SemVer, the major version will remain 0 until the API is deemed stable. During this period breaking changes will be indicated by bumping the minor version. Non-breaking changes will bump the patch version.

Install

go get -u pack.ag/amqp

Contributing

Contributions are welcome! Please see CONTRIBUTING.md.

Example Usage

package main

import (
	"context"
	"fmt"
	"log"
	"time"

	"pack.ag/amqp"
)

func main() {
	// Create client
	client, err := amqp.Dial("amqps://my-namespace.servicebus.windows.net",
		amqp.ConnSASLPlain("access-key-name", "access-key"),
	)
	if err != nil {
		log.Fatal("Dialing AMQP server:", err)
	}
	defer client.Close()

	// Open a session
	session, err := client.NewSession()
	if err != nil {
		log.Fatal("Creating AMQP session:", err)
	}

	ctx := context.Background()

	// Send a message
	{
		// Create a sender
		sender, err := session.NewSender(
			amqp.LinkTargetAddress("/queue-name"),
		)
		if err != nil {
			log.Fatal("Creating sender link:", err)
		}

		ctx, cancel := context.WithTimeout(ctx, 5*time.Second)

		// Send message
		err = sender.Send(ctx, amqp.NewMessage([]byte("Hello!")))
		if err != nil {
			log.Fatal("Sending message:", err)
		}

		sender.Close(ctx)
		cancel()
	}

	// Continuously read messages
	{
		// Create a receiver
		receiver, err := session.NewReceiver(
			amqp.LinkSourceAddress("/queue-name"),
			amqp.LinkCredit(10),
		)
		if err != nil {
			log.Fatal("Creating receiver link:", err)
		}
		defer func() {
			ctx, cancel := context.WithTimeout(ctx, 1*time.Second)
			receiver.Close(ctx)
			cancel()
		}()

		for {
			// Receive next message
			msg, err := receiver.Receive(ctx)
			if err != nil {
				log.Fatal("Reading message from AMQP:", err)
			}

			// Accept message
			msg.Accept()

			fmt.Printf("Message received: %s\n", msg.GetData())
		}
	}
}

Related Projects

Project Description
github.com/Azure/azure-event-hubs-go * Library for interacting with Microsoft Azure Event Hubs.
github.com/Azure/azure-service-bus-go * Library for interacting with Microsoft Azure Service Bus.
gocloud.dev/pubsub * Library for portably interacting with Pub/Sub systems.
qpid-proton AMQP 1.0 library using the Qpid Proton C bindings.

* indicates that the project uses this library.

Feel free to send PRs adding additional projects. Listed projects are not limited to those that use this library as long as they are potentially useful to people who are looking at an AMQP library.

Other Notes

By default, this package depends only on the standard library. Building with the pkgerrors tag will cause errors to be created/wrapped by the github.com/pkg/errors library. This can be useful for debugging and when used in a project using github.com/pkg/errors.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].