Skip to content

Commit 05f1138

Browse files
authored
chore(storage): remove gob encoding on rabbitmq (#86)
1 parent 6a62512 commit 05f1138

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

pkg/storage/rabbitmq/rabbitmq.go

+2-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package rabbitmq
22

33
import (
4-
"bytes"
5-
"encoding/gob"
4+
"fmt"
65

76
"github.com/streadway/amqp"
87

@@ -93,21 +92,14 @@ func (c storage) Name() string {
9392
// @param value that will be pushed
9493
// @return an error if the push failed
9594
func (c storage) Push(value interface{}) error {
96-
var buf bytes.Buffer
97-
98-
enc := gob.NewEncoder(&buf)
99-
if err := enc.Encode(value); err != nil {
100-
return err
101-
}
102-
10395
if err := c.channel.Publish(
10496
c.config.Exchange,
10597
c.routingKey.Name,
10698
c.config.Mandatory,
10799
c.config.Immediate,
108100
amqp.Publishing{
109101
ContentType: c.config.ContentType(),
110-
Body: []byte(buf.Bytes()),
102+
Body: []byte(fmt.Sprintf("%v", value)),
111103
}); err != nil {
112104
return err
113105
}

0 commit comments

Comments
 (0)