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

Add sample to create the client via dynamic proxy #847

Closed

Conversation

HEskandari
Copy link

Description

Add a sample on how to create the OpenSearchClient through DynamicProxy. This allows users to add custom logic around the client operations for cross-cutting concerns such as added logging, exception handling, or introducing delays and failures for testing purposes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Hadi Eskandari <[email protected]>
Signed-off-by: Hadi Eskandari <[email protected]>
@reta
Copy link
Collaborator

reta commented Feb 15, 2024

Hey @HEskandari, I believe this example does not belong here. Any kind of proxying / class rewrite / instrumentation ... is not the concern of OpenSearch Java Client but the framework or application that uses these techniques (hopefully, for reasons). In this regard, the OpenSearch Java Client APIs are no different than any other APIs out there.

@dblock
Copy link
Member

dblock commented Feb 15, 2024

@reta does it hurt to have it here? should it just be a SO or maybe someone's blog post? I'd be happy to have it on mine ;)

@reta
Copy link
Collaborator

reta commented Feb 15, 2024

@reta does it hurt to have it here? should it just be a SO or maybe someone's blog post? I'd be happy to have it on mine ;)

Sure @dblock , but do you really want that? There are few things to keep in mind: JDK releases easily break that (cglib has not been updated for the last 2 years, 3.3.0 was out in 2019). This is very shaky ground for the library whose business is not that ...

@dblock
Copy link
Member

dblock commented Feb 15, 2024

Yeah, I think I agree :(

@HEskandari
Copy link
Author

Moved the example here for whoever is interested. Closing.

@HEskandari HEskandari closed this Jun 5, 2024
@HEskandari HEskandari deleted the dynamic-proxy-sample branch June 5, 2024 20:28
@dblock
Copy link
Member

dblock commented Jun 5, 2024

Thanks for contributing the sample @HEskandari !

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 this pull request may close these issues.

3 participants