Skip to content

Commit

Permalink
Merge pull request #93 from kudlam/master
Browse files Browse the repository at this point in the history
Fixed partition key for batch
  • Loading branch information
devigned committed Feb 6, 2019
2 parents 3d4fed8 + f1747bd commit b14f5f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ func (b *EventBatch) toEvent() (*Event, error) {
Format: batchMessageFormat,
}

if b.PartitionKey != nil {
msg.Annotations = make(amqp.Annotations)
msg.Annotations[partitionKeyAnnotationName] = b.PartitionKey
}

for idx, event := range b.Events {
innerMsg := event.toMsg()
bin, err := innerMsg.MarshalBinary()
Expand Down

0 comments on commit b14f5f2

Please sign in to comment.