Skip to content

Commit

Permalink
Extracted common methods to single place
Browse files Browse the repository at this point in the history
  • Loading branch information
jaroslaw-bochniak committed Sep 17, 2020
1 parent b657a1a commit fe51ce0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/queue/duplicate.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func declareExchange(client *rabbithole.Client, srcVHost string, dstExchange str
Durable: false,
AutoDelete: true,
})
commons.AbortIfErrorWithMsg(fmt.Sprintf("Unable to create %s/%s exchange", srcVHost, dstExchange), err)
commons.HandleGeneralResponse(fmt.Sprintf("Creating %s/%s exchange", srcVHost, dstExchange), res)
commons.AbortIfErrorWithMsg(fmt.Sprintf("Unable to create %s/%s exchange", srcVHost, dstExchange), err)
}

func declareQueue(client *rabbithole.Client, srcVHost string, queueName string) {
Expand All @@ -51,8 +51,8 @@ func declareQueue(client *rabbithole.Client, srcVHost string, queueName string)
AutoDelete: false,
Arguments: nil,
})
commons.AbortIfErrorWithMsg(fmt.Sprintf("Unable to create queue %s/%s queue", srcVHost, queueName), err)
commons.HandleGeneralResponse(fmt.Sprintf("Creating %s/%s queue", srcVHost, queueName), res)
commons.AbortIfErrorWithMsg(fmt.Sprintf("Unable to create queue %s/%s queue", srcVHost, queueName), err)
}

func declareBindingForQueue(client *rabbithole.Client, srcVHost string, dstExchange string, queueName string) {
Expand All @@ -62,8 +62,8 @@ func declareBindingForQueue(client *rabbithole.Client, srcVHost string, dstExcha
Destination: queueName,
DestinationType: "queue",
})
commons.AbortIfErrorWithMsg(fmt.Sprintf("Unable to create binding between exchange %s/%s and queue %s/%s queue", srcVHost, dstExchange, srcVHost, queueName), err)
commons.HandleGeneralResponse(fmt.Sprintf("Creating binding for %s/%s queue", srcVHost, queueName), res)
commons.AbortIfErrorWithMsg(fmt.Sprintf("Unable to create binding between exchange %s/%s and queue %s/%s queue", srcVHost, dstExchange, srcVHost, queueName), err)
}

func declareShovel(client *rabbithole.Client, srcVHost string, srcQueue string, dstExchange string, shovelName string) {
Expand Down

0 comments on commit fe51ce0

Please # to comment.