func NewPublisher(amqpURI, exchange, queue, tag string, prefetch int) *RabbitMQ {
	conn, err := amqp.Dial(amqpURI)
	if err != nil {
		log.Fatalf("writer failed to connect to Rabbit: %s", err)
		return nil
	}
	go func() {
		log.Printf("writer closing: %s", <-conn.NotifyClose(make(chan *amqp.Error)))
		log.Printf("writer blocked by rabbit: %v", <-conn.NotifyBlocked(make(chan amqp.Blocking)))
	}()
	channel, err := conn.Channel()
	if err != nil {
		log.Fatalf("writer failed to get a channel from Rabbit: %s", err)
		return nil
	}
	if err = channel.ExchangeDeclarePassive(
		exchange,  
		"topic",   
		true,      
		false,     
		false,     
		false,     
		nil,       
	); err != nil {
		log.Fatalf("Exchange Declare: %s", err)
	}
	r := &RabbitMQ{
		conn:            conn,
		channel:         channel,
		exchange:        exchange,
		contentType:     "application/json",
		contentEncoding: "UTF-8",
	}
	log.Print("RabbitMQ connected: ", amqpURI)
	return r
}
NewPublisher creates and sets up a RabbitMQ Publisher
package rmq
import (
	"log"
	"github.com/streadway/amqp"
)