Replies: 3 comments 2 replies
-
/cc @alesj(grpc), @cescoffier(grpc) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Why not? |
Beta Was this translation helpful? Give feedback.
2 replies
-
What do you mean as a client?
You can use Quarkus to run some request, and then explicitly shut it down.
Think of it as a lambda function …
…On Wed, 18 Jan 2023 at 09:46, Dorian ***@***.***> wrote:
I'm sorry I only come back to this now - I was working on different
projects.
Just to make this clear in before, is it possible to use Quarkus only as a
client (for gRPC and Kafka), without any resteasy or other (HTTP) servers,
etc. - therefore only the client?
Afaic for that I would only need the dependencies and a method that loads
a configuration file, then goes through all classes to find classes
annotated with @ApplicationScoped and in those classes, find variables
annotated with @Inject <https://github.com/Inject> or in case of gRPC
@gRPCClient.
The Quarkus.run() method I found here
<https://quarkus.io/guides/lifecycle#the-main-method>, has a lot of
things attached I don't need, like the quarkus-ide-launcher module (which
gets shaded into my jar, but shouldn't be there from what I read in some
GitHub Issues). I asssume the correct method to start Quarkus in my use
case (which is that my jar itself is not self contained/executable, but
gets loaded via another application dynamically at runtime as a kind of
plugin and then has its onEnabled method called, from where I'm trying to
start up Quarkus and use the gRPC Client) would be
Quarkus.manualInitialize(). But aside from the comment above the method
itself, I cannot find ANY documentation whatsoever about how to use it
properly. When I try to use that method, I get an ClassNotFoundException
because io.quarkus.runner.ApplicationImpl couldn't be found. I think this
method is usally generated by Quarkus, but it is not for some reason.
Could you give me any further advice for my specific situation? Is Quarkus
even supposed to be used in a client only scenario (because it seems that
Quarkus itself has some kind of lifecycle, which a client would normally
not have/need, from my understanding. It'd just load a config, initialize
the gRPC client and that client can then used by my code to access the gRPC
server, but Quarkus seems to be running something in the background (aside
from the gRPC connection), as Quarkus.run is a blocking method).
Thanks a lot already :)
For completeness, the exception Quarkus.run() is throwing:
java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "java.net.URL.getPath()" because "resource" is null
at io.quarkus.launcher.QuarkusLauncher.launch(QuarkusLauncher.java:58) ~[?:?]
at io.quarkus.runtime.Quarkus.launchFromIDE(Quarkus.java:101) ~[?:?]
at io.quarkus.runtime.Quarkus.run(Quarkus.java:88) ~[?:?]
at io.quarkus.runtime.Quarkus.run(Quarkus.java:44) ~[?:?]
at io.quarkus.runtime.Quarkus.run(Quarkus.java:124) ~[?:?]
at com.xiamli.testplugin.TestPlugin.onEnable(TestPlugin.java:37) ~[?:?]
// only methods from the application, which loads and then calls my plugin
at java.lang.Thread.run(Thread.java:1589) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.net.URL.getPath()" because "resource" is null
at io.quarkus.launcher.QuarkusLauncher.launch(QuarkusLauncher.java:31) ~[?:?]
... 17 more
—
Reply to this email directly, view it on GitHub
<#30077 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACRA6B2OG3IVFU2PPAPKFDWS6UV5ANCNFSM6AAAAAATJ4VDJA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I created a gRPC Microservice using Quarkus, which I wanna consume now. But its consumed from a non-web application. Its a application that starts as a standalone.
Usually, I would just import a library and use it, but I can't just add Quarkus' gRPC as a maven module.
I could also go ahead and use grpc-java/grpc.io, but then I wouldn't have support for Mutiny plus I would need to learn a second library, one for server, one for client.
Is there currently no real solution for this, or am I overseeing something? Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions