Skip to content
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

Unable to set meta when using call #69

Closed
morkeleb opened this issue Aug 2, 2023 · 4 comments · Fixed by #71
Closed

Unable to set meta when using call #69

morkeleb opened this issue Aug 2, 2023 · 4 comments · Fixed by #71

Comments

@morkeleb
Copy link

morkeleb commented Aug 2, 2023

When I use the repel with JSON-strings it wont add meta to the call.

call v1.myService.action '{"run": true}' '{"myExtra": "data"}'

will call the service v1.myService.action with {run: true} but it wont add {myExtra: 'data'} to the meta of the request. The meta is always only { '$repl': true }.

I start the repl with:

  const broker = await startBroker();
  broker.repl()
@AndreMaz
Copy link
Member

AndreMaz commented Aug 2, 2023

Hi @morkeleb

this should do the trick

call "math.add" --a 5 --#b Bob --$timeout 1
// params will be { a: 5 }, meta will be { b: 'Bob' } and options will be { timeout: 1 }

as an alternative you can use --loadFull flag (more info here: #61)

@morkeleb
Copy link
Author

morkeleb commented Aug 4, 2023

Yes. But as stated in the documentation the following should work:

call [options] <actionName> [jsonParams] [meta]

@icebob
Copy link
Member

icebob commented Aug 6, 2023

@AndreMaz could you reproduce it, plz?

@AndreMaz
Copy link
Member

AndreMaz commented Aug 6, 2023

@icebob the # (e.g, --#metaParam ) option is working fine. However, passing meta as JSON encoded as string was failing.
This PR should fix it #71

@icebob icebob closed this as completed in #71 Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants