import (
"fmt"
"github.com/PMoneda/carrot"
)
func main(){
config := carrot.ConnectionConfig{
Host: os.Getenv("RABBITMQ_HOST"),
Username: os.Getenv("RABBITMQ_USERNAME"),
Password: os.Getenv("RABBITMQ_PASSWORD"),
VHost: "/",
}
exchangeName := "my_exchange"
var conn *carrot.BrokerClient
builder = carrot.NewBuilder(conn)
builder.UseVHost("plataforma_v1.0")
builder.DeclareTopicExchange(exchangeName)
builder.DeclareTopicExchange(exchangeName + "_error")
builder.UpdateTopicPermission(config.Username, exchangeName)
builder.UpdateTopicPermission(config.Username, exchangeName+"_error")
subConn, _ := carrot.NewBrokerClient(&config)
subscriber = carrot.NewSubscriber(subConn)
pubConn, _ := carrot.NewBrokerClient(&config)
publisher = carrot.NewPublisher(pubConn)
pickerConn, _ := carrot.NewBrokerClient(&config)
picker = carrot.NewPicker(pickerConn)
}
-
Notifications
You must be signed in to change notification settings - Fork 0
Carrot is a high level message broker framework
License
PMoneda/carrot
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Carrot is a high level message broker framework
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published