Skip to content

Commit

Permalink
make all options the same for mq
Browse files Browse the repository at this point in the history
  • Loading branch information
shreddedbacon committed Jul 28, 2020
1 parent 5ae1537 commit 1c607bb
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package main

import (
"flag"
"fmt"
"os"
"time"

Expand Down Expand Up @@ -109,37 +110,56 @@ func main() {
Name: "lagoon-tasks",
Type: "direct",
Options: mq.Options{
"durable": true,
"durable": true,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
},
},
Consumers: mq.Consumers{
{
Name: "remove-queue",
// RoutingKey: lagoonTargetName + ":remove",
Queue: "lagoon-tasks:" + lagoonTargetName + ":remove",
Name: "remove-queue",
Queue: fmt.Sprintf("lagoon-tasks:%s:remove", lagoonTargetName),
Workers: 1,
Options: mq.Options{
"durable": true,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
}, {
Name: "builddeploy-queue",
// RoutingKey: lagoonTargetName + ":builddeploy",
Queue: "lagoon-tasks:" + lagoonTargetName + ":builddeploy",
Name: "builddeploy-queue",
Queue: fmt.Sprintf("lagoon-tasks:%s:builddeploy", lagoonTargetName),
Workers: 1,
Options: mq.Options{
"durable": true,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
},
},
Queues: mq.Queues{
{
Name: "lagoon-tasks:" + lagoonTargetName + ":builddeploy",
Name: fmt.Sprintf("lagoon-tasks:%s:builddeploy", lagoonTargetName),
Exchange: "lagoon-tasks",
RoutingKey: lagoonTargetName + ":builddeploy",
RoutingKey: fmt.Sprintf("%s:builddeploy", lagoonTargetName),
Options: mq.Options{
"durable": true,
"durable": true,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
}, {
Name: "lagoon-tasks:" + lagoonTargetName + ":remove",
Name: fmt.Sprintf("lagoon-tasks:%s:remove", lagoonTargetName),
Exchange: "lagoon-tasks",
RoutingKey: lagoonTargetName + ":remove",
RoutingKey: fmt.Sprintf("%s:remove", lagoonTargetName),
Options: mq.Options{
"durable": true,
"durable": true,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
},
},
Expand All @@ -148,23 +168,25 @@ func main() {
Name: "lagoon-logs",
Exchange: "lagoon-logs",
Options: mq.Options{
"content_type": "text/plain",
"app_id": lagoonAppID,
"delivery_mode": 2,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
},
{
Name: "lagoon-tasks:operator",
Exchange: "lagoon-tasks",
RoutingKey: "operator",
Options: mq.Options{
"content_type": "text/plain",
"app_id": lagoonAppID,
"delivery_mode": 2,
"delivery_mode": "2",
"headers": "",
"content_type": "",
},
},
},
DSN: "amqp://" + mqUser + ":" + mqPass + "@" + mqHost + "/",
DSN: fmt.Sprintf("amqp://%s:%s@%s/", mqUser, mqPass, mqHost),
}
messaging := handlers.NewMessaging(config, mgr.GetClient())
// if we are running with MQ support, then start the consumer handler
Expand Down

0 comments on commit 1c607bb

Please sign in to comment.