Closed jirihnidek closed 1 year ago
How should echo worker work in remote content mode? Should we use metadata somehow? It looks like that return_url should have some special meaning: https://github.com/RedHatInsights/yggdrasil/wiki/Protocol#data-messages, but it is not described there. Documentation contains only example.
The echo
worker does not run in remote content mode, so it does not need to be addressed.
How should echo worker work in remote content mode? Should we use metadata somehow? It looks like that return_url should have some special meaning: https://github.com/RedHatInsights/yggdrasil/wiki/Protocol#data-messages, but it is not described there. Documentation contains only example.
The
echo
worker does not run in remote content mode, so it does not need to be addressed.
The echo
worker does work in remote content mode: https://github.com/RedHatInsights/yggdrasil/blob/main/worker/echo/main.go#L64
How should echo worker work in remote content mode? Should we use metadata somehow? It looks like that return_url should have some special meaning: https://github.com/RedHatInsights/yggdrasil/wiki/Protocol#data-messages, but it is not described there. Documentation contains only example.
The
echo
worker does not run in remote content mode, so it does not need to be addressed.The
echo
worker does work in remote content mode: https://github.com/RedHatInsights/yggdrasil/blob/main/worker/echo/main.go#L64
Who would have enabled that?! I didn't approve it! Looks at git blame
Oh. It was me. :blush:
How should echo worker work in remote content mode? Should we use metadata somehow? It looks like that return_url should have some special meaning: https://github.com/RedHatInsights/yggdrasil/wiki/Protocol#data-messages, but it is not described there. Documentation contains only example.
return_url
does not have any special meaning. It exists in the documentation only as an example. The contents of the message metadata
are converted into the HTTP headers for the resulting HTTP request. The only special field is the value of the addr
field. In remote-content mode, the value of that field is parsed as a URL. If the echo worker should do anything, it should set the value of the addr
field in its response to a valid URL.
Describe the bug The example echo worker just send messages as it was received, but it is not correct. Structure of data message is described here: https://github.com/RedHatInsights/yggdrasil/wiki/Protocol#data-messages
To Reproduce
go run ./cmd/yggd --server tcp://localhost:1883 --log-level trace --client-id $(hostname)
go run ./worker/echo -log-level trace
sub -broker tcp://localhost:1883 -topic yggdrasil/$(hostname)/#
go run ./cmd/yggctl generate data-message --directive echo "hello" | pub -broker tcp://localhost:1883 -topic yggdrasil/$(hostname)/data/in
Current behavior You can see following messages on Terminal 3:
Message send from Terminal 4:
2023/06/23 15:55:16 [yggdrasil/thinkpad-p1/data/in]
And response from echo worker:
2023/06/23 15:55:16 [yggdrasil/thinkpad-p1/data/out]
As you can see the
message_id
is still the same in the response (ebe2e691-1420-4cce-adcc-d1228c6c34d0
), butresponse_to
is not set.Expected behavior Response from echo worker should have unique
message_id
and it should setresponse_to
to received message.Additional Information
Open Questions How should echo worker work in remote content mode? Should we use metadata somehow? It looks like that
return_url
should have some special meaning: https://github.com/RedHatInsights/yggdrasil/wiki/Protocol#data-messages, but it is not described there. Documentation contains only example.