func NewRabbitService(
	config *RabbitSeasoning,
	passphrase string,
	salt string,
	processPublishReceipts func(*PublishReceipt),
	processError func(error)) (*RabbitService, error) {
	connectionPool, err := NewConnectionPool(config.PoolConfig)
	if err != nil {
		return nil, err
	}
	publisher := NewPublisherFromConfig(config, connectionPool)
	topologer := NewTopologer(connectionPool)
	rs := &RabbitService{
		ConnectionPool:       connectionPool,
		Config:               config,
		Publisher:            publisher,
		Topologer:            topologer,
		centralErr:           make(chan error, 1000),
		shutdownSignal:       make(chan bool, 1),
		consumers:            make(map[string]*Consumer),
		monitorSleepInterval: time.Duration(200) * time.Millisecond,
		serviceLock:          &sync.Mutex{},
	}
	err = rs.createConsumers(config.ConsumerConfigs)
	if err != nil {
		return nil, err
	}
	if config.EncryptionConfig.Enabled && len(passphrase) > 0 && len(salt) > 0 {
		rs.Config.EncryptionConfig.Hashkey = GetHashWithArgon(
			passphrase,
			salt,
			rs.Config.EncryptionConfig.TimeConsideration,
			rs.Config.EncryptionConfig.MemoryMultiplier,
			rs.Config.EncryptionConfig.Threads,
			32)
		rs.encryptionConfigured = true
	}
	go rs.collectConsumerErrors()
	go rs.monitorForShutdown()
	if processPublishReceipts != nil {
		go rs.invokeProcessPublishReceipts(processPublishReceipts)
	} else {  
		go rs.processPublishReceipts()
	}
	if processError != nil {
		go rs.invokeProcessError(processError)
	} else {  
		go rs.processErrors()
	}
	rs.Publisher.StartAutoPublishing()
	return rs, nil
}
NewRabbitService creates everything you need for a RabbitMQ communication service.
package tcr
import (
	"errors"
	"fmt"
	"os"
	"sync"
	"time"
	"github.com/google/uuid"
	"github.com/streadway/amqp"
)
type RabbitService struct {
	Config               *RabbitSeasoning
	ConnectionPool       *ConnectionPool
	Topologer            *Topologer
	Publisher            *Publisher
	encryptionConfigured bool
	centralErr           chan error
	consumers            map[string]*Consumer
	shutdownSignal       chan bool
	shutdown             bool
	monitorSleepInterval time.Duration
	serviceLock          *sync.Mutex
}