Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 6.7% on proxy.golang.org
Top 5.0% forks on proxy.golang.org

proxy.golang.org : github.com/blokur/harego/v2

Package harego contains the logic for communicating with RabbitMQ. A Publisher wraps an exchange in a concurrent safe manner for publishing messages to RabbitMQ. Zero value is not usable therefore a Publisher should be constructed with NewPublisher() function. The only requirement for a Publisher to operate is a connector that returns a connection to the broker. There is also a helper function that can create a new connection from the address of the broker. The Publisher will create 1 worker by default for publishing messages. The default exchange of the Publisher is "default" and it is set with the "topic" type. The default delivery method is persistent. You can use provided ConfigFunc functions to change the Publisher's behaviour. You should call the Close() method when you are done with this object, otherwise it will leak goroutines. NewPublisher returns a Publisher instance. You can configure the object by providing ConfigFunc functions. See ConfigFunc documentation for more information. If the publisher is setup with multiple workers, each Publish call will go through the next available worker. A Consumer wraps a queue in a concurrent safe manner for receiving messages from RabbitMQ. If the Consumer doesn't have a queue name set, it will not create a queue. Zero value is not usable, therefore a Consumer should be constructed with NewConsumer() function. The only requirement for a Consumer to operate is a connector that returns a connection to the broker. There is also a helper function that can create a new connection from the address of the broker. The Consumer will create 1 worker by default for consuming messages. The default delivery method is persistent. You can use provided ConfigFunc functions to change the Consumer's behaviour. Make sure to provide a queue name. The Consumer binds the queue to the given exchange. You should call the Close() method when you are done with this object, otherwise it will leak goroutines. NewConsumer returns an Consumer instance. You can configure the object by providing ConfigFunc functions. See ConfigFunc documentation for more information. Consume calls the handler with the next available message from the next available worker. It stops handling messages when the context is done or the consumer is closed. Consume internally creates a Publisher for requeueing messages. By default messages are consumed with false autoAck. Make sure you have enough workers so the Consume is not clogged on delays.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/blokur/harego/v2
Keywords: amqp, go, golang, library, rabbitmq
License: Apache-2.0
Latest release: 7 months ago
First release: over 1 year ago
Namespace: github.com/blokur/harego
Stars: 9 on GitHub
Forks: 4 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 17 days ago

    Loading...
    Readme
    Loading...