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

Can WireMock gRPC extension be used with this? #58

Open
ranjanashish opened this issue Oct 26, 2023 · 21 comments
Open

Can WireMock gRPC extension be used with this? #58

ranjanashish opened this issue Oct 26, 2023 · 21 comments

Comments

@ranjanashish
Copy link

https://mvnrepository.com/artifact/org.wiremock/wiremock-grpc-extension

@chberger
Copy link
Contributor

HI @ranjanashish Thanks for your question. Actually, I'm not familiar with the referenced extension yet. However, if I get some time I'll investigate it.

@ranjanashish
Copy link
Author

ranjanashish commented Oct 27, 2023

Hi Christian, Thank you for looking into it. I recently attended a talk at SF Java group where Tom presented this extension. I am sharing the link to the talk here in case you find it helpful - https://youtu.be/RDZTDsNXeLw?si=63GwV7U8G87ikj6O

@chberger
Copy link
Contributor

chberger commented Nov 4, 2023

I've watched the video - thanks for sharing it. The main challenge is the gRPC extension comes via an additional dependency. It's not part of the core WireMock library. So this Quarkus extension would need to load that extension on demand, which seems to be a little bit tricky. Let me think about it, maybe I'll come up with an idea how to support such extensions in a practical manner.

@oleg-nenashev
Copy link

I think the best possible solution would be creating a WireMock Dev Service, based on https://github.com/wiremock/wiremock-testcontainers-java that supports extensions, etc.. Happy to cooperate on that @chberger

@tomakehurst
Copy link

@chberger WireMock can automatically load extensions via Java's service loader mechanism. There's a config flag you need to enable on WireMock's startup options, but otherwise placing the extension JAR file on the classpath would be enough.

@chberger
Copy link
Contributor

Hi @tomakehurst, thanks for pointing this out. I'm already aware of this feature. Your documentation is quite good. Btw: I am honored that you are interested in this extension :-)

So personally I think there is no need to introduce testcontainers just to accomplish this integration. Anyhow, I would need a little bit more time to understand the Quarkus gRPC approach. The idea is that this extension should work with the Quarkus gRPC extension seamlessly. I don't think the integration would be complex or somehow tight coupled, but I just need a little bit more time to familiarize myself with the gRPC examples:

Since @oleg-nenashev offered some support, we maybe could share some work. wdyt?

@oleg-nenashev
Copy link

Work in progress, I guess!

Copy link

@chberger This is being labeled as stale.

@github-actions github-actions bot added the Stale label Jan 27, 2024
@chberger
Copy link
Contributor

Yeah, it's on on my list. I'll implement it as soon as all the basic issues are solved.

@github-actions github-actions bot removed the Stale label Jan 28, 2024
@edeandrea
Copy link

edeandrea commented Mar 27, 2024

@chberger I'm happy to collaborate on this if you would like. I would like to be able to combine the WIremock gRPC extension with this dev service, as I would like to have this capability in the Quarkus Superheroes.

Note though that the application in question doesn't necessarily have to implement a gRPC service. It's more likely that because it wants to use Wiremock it is a consumer of a gRPC service that wants to mock a gRPC backend.

I've also contributed to the Wiremock gRPC extension, so I have history with both.

Today I'm doing this: https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-fights/src/test/java/io/quarkus/sample/superheroes/fight/LocationsWiremockGrpcServerResource.java and consuming it in https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-fights/src/test/java/io/quarkus/sample/superheroes/fight/rest/FightResourceIT.java

But because its not part of the DevService it can only be used in tests.

The rest-fights service hasn't yet been converted to use the Wiremock Quarkus extension at all. Basically I create 2 WireMock instances - 1 for the REST clients and 1 for the gRPC client.

@chberger
Copy link
Contributor

chberger commented Apr 8, 2024

Hi @edeandrea,

Firstly, I want to extend my apologies for the delayed response. I've been quite busy with my full-time job lately, but I deeply appreciate your offer to help. 💪

Your proposal sounds incredibly valuable, and I am very much open to collaborating. 👍

Regarding the Wiremock gRPC extension integration: IMHO the Quarkus Wiremock extension should ideally work seamlessly with the Quarkus gRPC extension. It appears that the Quarkus gRPC extension offers its own Devservice, which might reduce the necessity for an additional tool like this extension in this context. However, I might have overlooked something, as my assessment was rather brief. In light of this, do you think it's still advantageous to pursue mocking gRPC services with the Wiremock gRPC extension?

Your insights would be incredibly valuable here.

Thank you once again for your patience and willingness to assist. I look forward to your thoughts on this matter.

@geoand also contributed the extension scanning mechanism via the Java's service loader mechanism: #111. I guess this might be helpful as mentioned here #58 (comment)

@edeandrea
Copy link

No worries at all @chberger !

Regarding the Wiremock gRPC extension integration: IMHO the Quarkus Wiremock extension should ideally work seamlessly with the Quarkus gRPC extension. It appears that the Quarkus gRPC extension offers its own Devservice, which might reduce the necessity for an additional tool like this extension in this context. However, I might have overlooked something, as my assessment was rather brief. In light of this, do you think it's still advantageous to pursue mocking gRPC services with the Wiremock gRPC extension?

I'm not sure what you mean? I'm not familiar with any gRPC Dev service that provides mocking like the Wiremock gRPC service does. I know the Microcks extension can, & we use that in one of the apps in the superheroes.

Copy link

github-actions bot commented Jun 8, 2024

@chberger This is being labeled as stale.

@github-actions github-actions bot added the Stale label Jun 8, 2024
@chberger chberger removed the Stale label Jun 13, 2024
Copy link

@chberger This is being labeled as stale.

@github-actions github-actions bot added the Stale label Aug 13, 2024
@chberger chberger removed the Stale label Aug 14, 2024
Copy link

@chberger This is being labeled as stale.

@github-actions github-actions bot added the Stale label Oct 13, 2024
Copy link

@chberger This is being closed due to inactivity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 20, 2024
@ranjanashish
Copy link
Author

Please reopen this.

@chberger chberger reopened this Oct 21, 2024
@chberger
Copy link
Contributor

Not stale

@chberger chberger removed the Stale label Oct 21, 2024
@chberger chberger pinned this issue Oct 24, 2024
Copy link

@quarkiverse/quarkiverse-wiremock This is being labeled as stale.

@github-actions github-actions bot added the Stale label Dec 20, 2024
Copy link

@quarkiverse/quarkiverse-wiremock This is being closed due to inactivity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2024
@ranjanashish
Copy link
Author

Please reopen

@chberger chberger reopened this Dec 30, 2024
@chberger chberger removed the Stale label Dec 30, 2024
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

5 participants