You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@edgent.apache.org by "Dale LaBossiere (JIRA)" <ji...@apache.org> on 2017/03/29 13:03:41 UTC
[jira] [Created] (EDGENT-403) Wish IotDevice.events() exposed
support for byte[] payloads
Dale LaBossiere created EDGENT-403:
--------------------------------------
Summary: Wish IotDevice.events() exposed support for byte[] payloads
Key: EDGENT-403
URL: https://issues.apache.org/jira/browse/EDGENT-403
Project: Edgent
Issue Type: Wish
Components: Connectors
Reporter: Dale LaBossiere
Priority: Minor
I had an application that wanted to publish device events having a byte[] payload. In this case it wanted to publish a png image.
I worked around the issue by MIME (base64) encoding the image and then having that string as an attribute in the JsonObject to publish. Of course the encoding utilized some additional CPU cycles and increased the payload size a bit.
MQTT supports publishing a byte[]. Edgent's {{MqttStreams.publish()}} exposes that. {{IotDevice.events()}} does not, hence neither does Edgent's {{MqttDevice}}. WIoTP supports byte[] payloads. Edgent's {{IotpDevice}} doesn't expose that capability.
Suggest adding something along the lines of:
{code}
IotDevice.events(TStream<T> stream, Function<T, String> topic, Function<T, byte[]> payload, Function<T, String> format, Function<T, int> qos)
{code}
and enhancing MqttDevice and IotpDevice accordingly, as well as IotGateway and IotpGateway.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)