Skip to content

Commit 666b0d8

Browse files
Merge pull request #470 from lohithpc1/property-feature
Adding properties field to activemq.go
2 parents 0f46684 + 35709c2 commit 666b0d8

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

events/activemq.go

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type ActiveMQMessage struct {
2323
Data string `json:"data"`
2424
BrokerInTime int64 `json:"brokerInTime"`
2525
BrokerOutTime int64 `json:"brokerOutTime"`
26+
Properties map[string]string `json:"properties"`
2627
}
2728

2829
type ActiveMQDestination struct {

events/activemq_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func TestActiveMQEventMarshaling(t *testing.T) {
3030
assert.Equal(t, 1, message.DeliveryMode)
3131
assert.Equal(t, "testQueue", message.Destination.PhysicalName)
3232
assert.Equal(t, false, message.Redelivered)
33+
assert.Equal(t, "testValue", message.Properties["testKey"])
3334

3435
// 4. serialize to JSON
3536
outputJSON, err := json.Marshal(inputEvent)

events/testdata/activemq-event.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"priority": 0,
1919
"data": "RW50ZXIgc29tZSB0ZXh0IGhlcmUgZm9yIHRoZSBtZXNzYWdlIGJvZHkuLi4=",
2020
"brokerInTime": 1599863938943,
21-
"brokerOutTime": 1599863938944
21+
"brokerOutTime": 1599863938944,
22+
"properties": {"testKey": "testValue"}
2223
}
2324
]
2425
}

0 commit comments

Comments
 (0)