-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
yggdrasil does not dispatch, when worker is remote content mode #208
Comments
jirihnidek
added a commit
that referenced
this issue
Feb 20, 2024
* When worker was in remote content mode, then yggdrasil still expects raw data as valid JSON document. URL like: http://example.com/ is not valid JSON document. It could be e.g. "http://example.com/" * Not sure if this is the best solution, but it solves the issue described in issue #208
Good catch. "Remote content" mode already makes assumptions about the format and value of the message content already, so we could assume it contains a JSON string fragment and a URL. That way we can first unmarshal it to JSON and then parse the JSON string as a URL. Would that work? |
jirihnidek
added a commit
that referenced
this issue
Mar 4, 2024
* When worker was in remote content mode, then yggdrasil still expects raw data as valid JSON document. URL like: http://example.com/ is not valid JSON document. It could be e.g. "http://example.com/" * Solves issue #208
jirihnidek
added a commit
that referenced
this issue
Mar 6, 2024
* When worker was in remote content mode, then yggdrasil still expects raw data as valid JSON document. URL like: http://example.com/ is not valid JSON document. It could be e.g. "http://example.com/" * Solves issue #208
jirihnidek
added a commit
that referenced
this issue
Mar 7, 2024
* When worker was in remote content mode, then yggdrasil still expects raw data as valid JSON document. URL like: http://example.com/ is not valid JSON document. It could be e.g. "http://example.com/" * Solves issue #208
subpop
pushed a commit
that referenced
this issue
Mar 8, 2024
* When worker was in remote content mode, then yggdrasil still expects raw data as valid JSON document. URL like: http://example.com/ is not valid JSON document. It could be e.g. "http://example.com/" * Solves issue #208
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When e.g. echo worker works in remote content mode, then dispatching message with URL does not work, because URL is not considered as valid JSON document. Contrary when URL is send encapsulated by quotation marks, then it is not valid URL.
To Reproduce
Steps to reproduce the behavior:
go run ./cmd/yggd --server tcp://localhost:1883 --log-level trace --client-id $(hostname)
go run ./worker/echo -log-level trace -remote-content
echo 'http://localhost/robots.txt' | go run ./cmd/yggctl generate data-message --directive echo - | pub -broker tcp://localhost:1883 -topic yggdrasil/$(hostname)/data/in
Or try to run:
echo '"http://localhost/robots.txt"' | go run ./cmd/yggctl generate data-message --directive echo - | pub -broker tcp://localhost:1883 -topic yggdrasil/$(hostname)/data/in
Expected behavior
yggdrasil tries to get data from given URL and it is dispatched to the worker.
Actual behavior
3.1
[yggd] 2024/02/20 11:36:42 /home/jhnidek/github/redhat-insights/yggdrasil/internal/transport/mqtt.go:72: cannot receive data message: cannot unmarshal data message: unexpected end of JSON input
3.2
[yggd] 2024/02/19 16:53:57 /home/jhnidek/github/redhat-insights/yggdrasil/internal/work/dispatcher.go:185: cannot dispatch data: cannot parse content as URL: parse ""http://localhost/robots.txt\"": first path segment in URL cannot contain colon
Additional Information
The text was updated successfully, but these errors were encountered: