Skip to content

Commit

Permalink
馃摝 new(proposal:transport) a way to abstruct away the rabbitmq
Browse files Browse the repository at this point in the history
Solve issue #158
Disconnects rabbitmq and allows addition of kafka or any other transport
  • Loading branch information
vladshub committed Dec 26, 2019
1 parent 60007d8 commit 353b834
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion gbus/abstractions.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"time"

"github.com/sirupsen/logrus"

"github.com/streadway/amqp"
)

Expand Down Expand Up @@ -284,3 +283,22 @@ type Logged interface {
SetLogger(entry logrus.FieldLogger)
Log() logrus.FieldLogger
}

type Transport interface {
Messaging
Logged
Health

Start() error
Stop() error

RPCChannel() <-chan BusMessage
MessageChannel() <-chan BusMessage

ErrorChan() <-chan error
BackPressureChannel() <-chan bool

ListenOnEvent(exchange, topic string) error
}

type NewTransport func(svcName, connString, DLX string, prefetchCount, maxRetryCount uint, purgeOnStartup, withConfirms bool, handler func(message *BusMessage), logger logrus.FieldLogger) Transport

0 comments on commit 353b834

Please sign in to comment.