Closed brocaar closed 5 years ago
panic: interface conversion: interface {} is nil, not string goroutine 204 [running]: github.com/amenzhinsky/iothub/common/commonamqp.FromAMQPMessage(0xc00040cbd0, 0x1) /tmp/iothub/common/commonamqp/message.go:51 +0xa68 github.com/amenzhinsky/iothub/iotservice.(*Client).SubscribeEvents.func1(0xc00040cbd0) /tmp/iothub/iotservice/client.go:208 +0x34 created by github.com/amenzhinsky/iothub/eventhub.SubscribePartitions /tmp/iothub/eventhub/client.go:132 +0x1e9
This is because the value is not a string:
string
https://github.com/amenzhinsky/iothub/blob/master/common/commonamqp/message.go#L46
fmt.Printf("%+v", msg.ApplicationProperties) returns:
fmt.Printf("%+v", msg.ApplicationProperties)
map[stats:<nil>]
This happends when a device sends a message (using MQTT) to the following topic: devices/DEVICEID/messages/events/stats
devices/DEVICEID/messages/events/stats
This is because the value is not a
string
:https://github.com/amenzhinsky/iothub/blob/master/common/commonamqp/message.go#L46
fmt.Printf("%+v", msg.ApplicationProperties)
returns:This happends when a device sends a message (using MQTT) to the following topic:
devices/DEVICEID/messages/events/stats