From where Etag shall be retrived on nats events?
ipzago opened this issue · 3 comments
Hello guys,
I'm trying to retrieve the Etag from a nats resourceChanged event but I'm not sure if I'm doing it right. The only Etag attribute that I found is in github.com/plgd-dev/hub/v2/resource-aggregate/events.ResourceChanged object, but it is nil.
Am I looking in the wrong place?
I'm using the plgd bundle ghcr.io/plgd-dev/hub/bundle:2.16.3
You are looking good, but there are a few things that are required:
-
The device needs to be compiled with the CMake option OC_ETAG_ENABLED using the command
cmake -DOC_ETAG_ENABLED=ON ...
, as described here. -
You also need to enable ETAG in the CoAP gateway via Helm using the configuration option .coapgateway.deviceTwin.useETags.
I realized that these two things were not described, so I have now added them to our documentation.
@jkralik many thanks for the answer
Just another thing... we're using plgd bundle and run the container directly with docker, we don't use Helm. How can we configure it without Helm?
Start by mounting a volume on the directory /data
. After the initial run, update the property deviceTwin.useETags
to true
in the file /data/coap-gateway-secure.yaml
, and then rerun the process using the same volume.