eclipse-uprotocol / up-spec

uProtocol Specifications
Apache License 2.0
31 stars 25 forks source link

File Attachment Feature #114

Open stevenhartley opened 4 months ago

stevenhartley commented 4 months ago

The file attachment feature allows uEs to "attach" file(s) metadata to any message sent (i.e. for publish, notification, request, response type messages). This feature was missed when we switched from cloudevents to UAttributes so it needs to be added back into the specifications and elaborated on throughout the specs.

When the message is consumed locally, the consumer references the local file address, when the message is sent across the device boundary, the file(s) are uploaded/downloaded based on the file transfer protocol and the file path is then updated in the message to reference the new file location. File transfer is typically done outside of the uTransport communication protocol using an optimized (and often proprietary) file transfer protocol. For the sake of the specifications we will use ftp for example but make it pluggable in the streamer.

This feature will impact the core-api, the language libraries, streamer libraries. this issue will be used to track the development and specification work.

sophokles73 commented 1 month ago

I can imagine two use cases here:

  1. A uE wants to use a file (reference) as the message's payload, i.e. the file contains the paylaoad, or
  2. a uE wants to simply refer to a file from within the message's payload.

In the latter case, nothing much should need to be done instead of having a property in the message that is of type URL. In the former case, we would probably need to define a new payload format, indicating that the payload is supposed to be retrieved from a URL contained in either the payload or a message attribute.