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

Support Composite and Routing metadata APIs #77

Closed
rstoyanchev opened this issue Sep 9, 2019 · 6 comments
Closed

Support Composite and Routing metadata APIs #77

rstoyanchev opened this issue Sep 9, 2019 · 6 comments

Comments

@rstoyanchev
Copy link
Contributor

Now that RSocket Java has CompositeMetadataFlyweight and RoutingMetadata/TaggingMetadataFlyweight based on the corresponding extensions, it would be useful if the CLI could support sending metadata encoded with those APIs.

Not sure how this works out into command line arguments, but for composite it's essentially multiple sets of metadataFormat and metadata pairs. For routing, a collection of tags.

@yschimke
Copy link
Member

What would a sample command look like? Something easy to type I guess.

@rstoyanchev
Copy link
Contributor Author

Sorry, I missed this comment..

I wasn't too sure about the difference between -h and -m initially but now I tend to think it could be that if you do -m multiple times then that's encoded with composite metadata. Of course metadataFormat would need to be a List too. It would get verbose to say --metadataFormat many times. Maybe this command line option accepts a list format?

@yschimke
Copy link
Member

yschimke commented Oct 2, 2019

@rstoyanchev I like that idea, makes a lot of sense. The order must match then between types and the metadata payloads. So we could also consider some way to combine those? e.g. type:payload?

But your suggestion works for me.

@rstoyanchev
Copy link
Contributor Author

rstoyanchev commented Oct 3, 2019

I wonder if @ArgGroup could help to enforce a sequence of --metadataFormat -m pairs which I think would provide sufficient structure.

I also notice support for maps, which could support --metadataEntry key value pairs like this:

-me application/foo="..." -me application/bar=@file -me ...

If we choose the latter, which I tend to like because it combines pairs naturally and is much shorter to type, I think it would make sense to avoid supporting both --metadataFormat + -m as well as a sequence of -me. Ideally it would be just -m key-value pair(s) but I'm not sure what the backwards compatibility expectation are. Adding -me or similar and deprecating -m could be another option.

@yschimke
Copy link
Member

yschimke commented Oct 3, 2019

No backwards compatibility. Design what makes sense for any firm requirements. The current impl is mostly for debugging.

@yschimke
Copy link
Member

Added --route in #91

Some potential cleanup in https://github.com/rsocket/rsocket-cli/pull/92/files

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

No branches or pull requests

2 participants