Skip to content

Commit

Permalink
fix: Fixing routing key configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Dec 4, 2021
1 parent fa74432 commit 7d6ce06
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Usage of exas:
-amqpRetryInterval string
[amqp] Interval duration when send fails {EXAS_AMQP_RETRY_INTERVAL} (default "1h")
-amqpRoutingKey string
[amqp] RoutingKey name {EXAS_AMQP_ROUTING_KEY} (default "exif")
[amqp] RoutingKey name {EXAS_AMQP_ROUTING_KEY} (default "exif_input")
-amqpURI string
[amqp] Address in the form amqps?://<user>:<password>@<address>:<port>/<vhost> {EXAS_AMQP_URI}
-cert string
Expand Down Expand Up @@ -106,7 +106,7 @@ Usage of exas:
-readTimeout string
[server] Read Timeout {EXAS_READ_TIMEOUT} (default "2m")
-routingKey string
[exas] AMQP Routing Key for fibr {EXAS_ROUTING_KEY} (default "exif")
[exas] AMQP Routing Key to fibr {EXAS_ROUTING_KEY} (default "exif_output")
-shutdownTimeout string
[server] Shutdown Timeout {EXAS_SHUTDOWN_TIMEOUT} (default "10s")
-tmpFolder string
Expand Down
7 changes: 4 additions & 3 deletions cmd/exas/api.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"flag"
"os"

Expand Down Expand Up @@ -33,7 +34,7 @@ func main() {
geocodeConfig := geocode.Flags(fs, "")

amqpConfig := amqp.Flags(fs, "amqp")
amqphandlerConfig := amqphandler.Flags(fs, "amqp", flags.NewOverride("Exchange", "fibr"), flags.NewOverride("Queue", "exas"), flags.NewOverride("RoutingKey", "exif"))
amqphandlerConfig := amqphandler.Flags(fs, "amqp", flags.NewOverride("Exchange", "fibr"), flags.NewOverride("Queue", "exas"), flags.NewOverride("RoutingKey", "exif_input"))

logger.Fatal(fs.Parse(os.Args[1:]))

Expand All @@ -51,9 +52,9 @@ func main() {
defer geocodeApp.Close()

amqpClient, err := amqp.New(amqpConfig, prometheusApp.Registerer())
if err != nil {
if err != nil && !errors.Is(err, amqp.ErrNoConfig) {
logger.Error("unable to create amqp client: %s", err)
} else {
} else if amqpClient != nil {
defer amqpClient.Close()
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/exas/exas.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func Flags(fs *flag.FlagSet, prefix string, overrides ...flags.Override) Config
workingDir: flags.New(prefix, "exas", "WorkDir").Default("", overrides).Label("Working directory for direct access requests").ToString(fs),

amqpExchange: flags.New(prefix, "exas", "Exchange").Default("fibr", nil).Label("AMQP Exchange Name").ToString(fs),
amqpRoutingKey: flags.New(prefix, "exas", "RoutingKey").Default("exif", nil).Label("AMQP Routing Key for fibr").ToString(fs),
amqpRoutingKey: flags.New(prefix, "exas", "RoutingKey").Default("exif_output", nil).Label("AMQP Routing Key to fibr").ToString(fs),
}
}

Expand Down

0 comments on commit 7d6ce06

Please sign in to comment.