Skip to content

Commit 33f1da4

Browse files
committed
Formatting
1 parent c346c5f commit 33f1da4

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ rabbitmq-dump-queue from source by running:
1818
go get github.com/dubek/rabbitmq-dump-queue
1919
```
2020

21+
The `rabbitmq-dump-queue` executable will be created in the `$GOPATH/bin`
22+
directory.
23+
2124

2225
## Usage
2326

main.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
package main
22

33
import (
4+
"encoding/json"
45
"flag"
56
"fmt"
6-
"github.com/streadway/amqp"
77
"io/ioutil"
8-
"encoding/json"
98
"os"
109
"path"
10+
11+
"github.com/streadway/amqp"
1112
)
1213

1314
var (
1415
uri = flag.String("uri", "amqp://guest:guest@localhost:5672/", "AMQP URI")
1516
queue = flag.String("queue", "", "Ephemeral AMQP queue name")
1617
maxMessages = flag.Uint("max-messages", 1000, "Maximum number of messages to dump")
1718
outputDir = flag.String("output-dir", ".", "Directory in which to save the dumped messages")
18-
full = flag.Bool("full", false, "Dump the message, its properties and headers")
19+
full = flag.Bool("full", false, "Dump the message, its properties and headers")
1920
verbose = flag.Bool("verbose", false, "Print progress")
2021
)
2122

@@ -93,17 +94,17 @@ func SaveMessageToFile(body []byte, outputDir string, counter uint) error {
9394

9495
func GetProperties(msg amqp.Delivery) map[string]interface{} {
9596
props := map[string]interface{}{
96-
"app_id": msg.AppId,
97+
"app_id": msg.AppId,
9798
"content_encoding": msg.ContentEncoding,
98-
"content_type": msg.ContentType,
99-
"correlation_id": msg.CorrelationId,
100-
"delivery_mode": msg.DeliveryMode,
101-
"expiration": msg.Expiration,
102-
"message_id": msg.MessageId,
103-
"priority": msg.Priority,
104-
"reply_to": msg.ReplyTo,
105-
"type": msg.Type,
106-
"user_id": msg.UserId,
99+
"content_type": msg.ContentType,
100+
"correlation_id": msg.CorrelationId,
101+
"delivery_mode": msg.DeliveryMode,
102+
"expiration": msg.Expiration,
103+
"message_id": msg.MessageId,
104+
"priority": msg.Priority,
105+
"reply_to": msg.ReplyTo,
106+
"type": msg.Type,
107+
"user_id": msg.UserId,
107108
}
108109

109110
if !msg.Timestamp.IsZero() {

0 commit comments

Comments
 (0)