Skip to content
/ conejo Public

Golang lib for simple RabbitMQ Connecting, Consuming, and Publishing

License

Notifications You must be signed in to change notification settings

jrobles/conejo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conejo Go Report Card GoDoc Sourcegraph

Golang lib for RabbitMQ Connecting, Consuming, and Publishing. Needs a great deal of refining, but it's quick & dirty and gets the job done for my current project. WIll definitely refactor in the near future.

Status

Currently on hold. I use this lib for several personal projects so all should be working as intended.

Goals

  • Unit Tests
    • main.go
    • channel.go
    • producer.go
    • queue.go
    • exchange.go

Usage

Sample Producer

package main

import (
  "github.com/josemrobles/conejo"
)

var (
  rmq      = conejo.Connect("amqp://guest:guest@localhost:5672")
  workQueue = make(chan string) 
  queue    = conejo.Queue{Name: "queue_name", Durable: false, Delete: false, Exclusive: false, NoWait: false}
  exchange = conejo.Exchange{Name: "exchange_name", Type: "topic", Durable: true, AutoDeleted: false, Internal: false, NoWait: false}
)

func main() {
  err := conejo.Publish(rmq, queue, exchange, "{'employees':[{'firstName':'John','lastName':'Doe'}]}")
  if err != nil {
    print("fubar")
  }
}

Sample Consumer

package main

import (
  "github.com/josemrobles/conejo"
)

var (
  rmq       = conejo.Connect("amqp://guest:guest@localhost:5672")
  queue     = conejo.Queue{Name: "queue_name", Durable: false, Delete: false, Exclusive: false, NoWait: false}
  exchange  = conejo.Exchange{Name: "exchange_name", Type: "topic", Durable: true, AutoDeleted: false, Internal: false, NoWait: false}
  
)

func main() {
  err := conejo.Consume(rmq, queue, exchange, "consumer_tag", workQueue)
  if err != nil {
    print("ERROR: %q", err)
  }
}

About

Golang lib for simple RabbitMQ Connecting, Consuming, and Publishing

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages