Skip to content

Commit

Permalink
remove generated msgid as it is not needed anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
felipejfc committed Oct 25, 2017
1 parent c290378 commit a0c7ddc
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion extensions/apns_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ func (a *APNSMessageHandler) sendMessage(message interfaces.KafkaMessage) error
} else {
n.Metadata["hostname"] = hostname
}
n.Metadata["msgid"] = uuid.NewV4().String()
a.InflightMessagesMetadata[deviceIdentifier] = n.Metadata
a.requestsHeap.AddRequest(deviceIdentifier)

Expand Down
5 changes: 1 addition & 4 deletions extensions/apns_message_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,14 @@ var _ = FDescribe("APNS Message Handler", func() {
Expect(err).NotTo(HaveOccurred())
})

It("should include a timestamp in feedback root and the hostname and msgid in metadata", func() {
It("should include a timestamp in feedback root and the hostname in metadata", func() {
timestampNow := time.Now().Unix()
msgID := uuid.NewV4().String()
hostname, err := os.Hostname()
Expect(err).NotTo(HaveOccurred())
metadata := map[string]interface{}{
"some": "metadata",
"timestamp": timestampNow,
"hostname": hostname,
"msgid": msgID,
"game": "game",
"platform": "apns",
}
Expand All @@ -474,7 +472,6 @@ var _ = FDescribe("APNS Message Handler", func() {
msg := <-mockKafkaProducerClient.ProduceChannel()
json.Unmarshal(msg.Value, fromKafka)
Expect(fromKafka.Timestamp).To(Equal(timestampNow))
Expect(fromKafka.Metadata["msgid"]).To(Equal(msgID))
Expect(fromKafka.Metadata["hostname"]).To(Equal(hostname))
})

Expand Down
2 changes: 0 additions & 2 deletions extensions/gcm_message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"sync"
"time"

uuid "github.com/satori/go.uuid"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
gcm "github.com/topfreegames/go-gcm"
Expand Down Expand Up @@ -330,7 +329,6 @@ func (g *GCMMessageHandler) sendMessage(message interfaces.KafkaMessage) error {
km.Metadata["hostname"] = hostname
}

km.Metadata["msgid"] = uuid.NewV4().String()
km.Metadata["game"] = message.Game
km.Metadata["platform"] = "gcm"

Expand Down
5 changes: 1 addition & 4 deletions extensions/gcm_message_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -530,16 +530,14 @@ var _ = Describe("GCM Message Handler", func() {

})

It("should include a timestamp in feedback root and the hostname and msgid in metadata", func() {
It("should include a timestamp in feedback root and the hostname in metadata", func() {
timestampNow := time.Now().Unix()
msgID := uuid.NewV4().String()
hostname, err := os.Hostname()
Expect(err).NotTo(HaveOccurred())
metadata := map[string]interface{}{
"some": "metadata",
"timestamp": timestampNow,
"hostname": hostname,
"msgid": msgID,
"game": "game",
"platform": "gcm",
}
Expand All @@ -556,7 +554,6 @@ var _ = Describe("GCM Message Handler", func() {
msg := <-mockKafkaProducerClient.ProduceChannel()
json.Unmarshal(msg.Value, fromKafka)
Expect(fromKafka.Timestamp).To(Equal(timestampNow))
Expect(fromKafka.Metadata["msgid"]).To(Equal(msgID))
Expect(fromKafka.Metadata["hostname"]).To(Equal(hostname))
})

Expand Down

0 comments on commit a0c7ddc

Please sign in to comment.