Skip to content

Commit

Permalink
Merge pull request #164 from sljeff/fix-typo
Browse files Browse the repository at this point in the history
fix typo `exchanges`; fix print
  • Loading branch information
HeathLee authored Jun 19, 2020
2 parents c4e6d81 + ae7ef77 commit bd45fb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions extensions/busext/amqp.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ func (b *BusExt) Consume() error {
return
case delivery := <-channel:
b.deliveryAck(delivery)
b.ErrorLogger.Printf("Receive delivery: %+v from queue: %v\n",
delivery, chName)
log.Printf("Receive delivery: %+v from queue: %v\n", delivery, chName)
var handler Handler
var ok bool
if delivery.Headers == nil {
Expand Down Expand Up @@ -325,7 +324,7 @@ func (b *BusExt) init(conn *amqp.Connection) error {
return err
}

for _, exchange := range b.config.GetStringSlice("exhanges") {
for _, exchange := range b.config.GetStringSlice("exchanges") {
err = ch.ExchangeDeclare(
exchange,
amqp.ExchangeTopic,
Expand All @@ -339,7 +338,7 @@ func (b *BusExt) init(conn *amqp.Connection) error {
b.ErrorLogger.Printf("declare exchange: %v failed: %v\n", exchange, err)
return err
}
b.ErrorLogger.Printf("declare exchange: %v succeeded\n", exchange)
log.Printf("declare exchange: %v succeeded\n", exchange)
}

for _, queue := range b.config.GetStringSlice("queues") {
Expand Down
2 changes: 1 addition & 1 deletion testdata/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ defaults: &defaults
bus_broker_url: "amqp://guest:[email protected]:5672/"
bus_reconnect_delay: "2s"
bus_reinit_delay: "1s"
bus_exhanges:
bus_exchanges:
- sbay-exchange
bus_queues:
- test
Expand Down

0 comments on commit bd45fb2

Please sign in to comment.