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

[FEATURE] Relay Request/Response actions between extensions #152

Closed
dbwiddis opened this issue Sep 19, 2022 · 1 comment
Closed

[FEATURE] Relay Request/Response actions between extensions #152

dbwiddis opened this issue Sep 19, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dbwiddis
Copy link
Member

Is your feature request related to a problem?

Extensions may need to request and respond to each other, including sharing classes with each other. Class sharing can be accomplished with NamedWriteables.

What solution would you like?

Create a Request type that forwards a request to another extension (given its uniqueId). The request should contain:

  • the uniqueId of the target
  • a String comprising the request, for data that can be serialized to JSON. May be empty.
  • a Map containing pairs of NamedWriteable name (key) byte content (value). May be empty.

The receiving handler should validate that any NamedWriteable names are registered and issue a failure response otherwise.

The receiving handler should lookup the target extension and forward the String and Map to it with a separate request.

The receiving handler should get the forwarding response and respond to the sending extensions appropriately.

What alternatives have you considered?

Direct extension communication is possible and will not be prohibited. Extensions will have the host/port information and could, in theory, directly send data. This may be a solution some developers choose. However, it should not be mandated to handle this.

Since the writeables are registered, The ExtensionsOrchestrator could deserialize them and then re-serialize the objects before sending them. This requires extra processing time to convert bytes into temporary objects, just to return the to the same sequence of bytes. The conversion of an object to bytes is most easily accomplished at the sender level (but inside the Request object using helper methods so it's transparent to the user.)

Do you have any additional context?

Review the classes in this package: some of them may be very helpful:
https://github.com/opensearch-project/OpenSearch/tree/main/server/src/main/java/org/opensearch/common/io/stream

@dbwiddis
Copy link
Member Author

Closing as this is duplicated by #525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant