Replies: 7 comments
-
I don't know how stable graalVM is last I checked it's still is an RC candidate we might also need to look at other http client libs that support aot code generation. |
Beta Was this translation helpful? Give feedback.
-
alternatively, you can now use pulsarctl. it is a static linked CLI written in golang. |
Beta Was this translation helpful? Give feedback.
-
Pulsar itself should also be built with AOT compilers to reduce the time to start the process. Sometimes it takes up to a minute to start the broker with function worker enabled. |
Beta Was this translation helpful? Give feedback.
-
I'm experiencing similar issues trying to make Micronaut integration for Pulsar Java client is really hard mainly due to reflection and Micronaut now demands that it can build for GraalVM native image. |
Beta Was this translation helpful? Give feedback.
-
Broker will require many changes and unlikely it can be made to work with graalvm anytime soon. Client should not an issue it has a dependency on netty , but netty authors should have already provided a guide to to use it with graal and it should work just fine. |
Beta Was this translation helpful? Give feedback.
-
Shaded client which is the one I have to use in this case as netty needs to be supported independently of the Pulsar Client so I really can't due to other limitations extract it. I can only research again what netty methods are used with reflection and try to list them with org.apache.pulsar... prefix. On the other hand looking at the source code I'm not sure how safe calls to Schema instantiation would be which heavily rely on reflection. In any case I've made own Jackson schema to support passing in ObjectMapper from framework while using shaded library. In many cases this library tends to give me warnings and such running on new Java versions like 14. This is why it would be nice if possible to have less of those reflection and unsafe calls. On the other hand I guess main issue is in fact in netty in my case I just have to list all of those calls with apache pulsar extension as package name. An example from my point of view is public static Schema<byte[]> newBytesSchema() {
return catchExceptions(
() -> (Schema<byte[]>) newClassInstance("org.apache.pulsar.client.impl.schema.BytesSchema")
.newInstance());
}
public static Schema<String> newStringSchema() {
return catchExceptions(
() -> (Schema<String>) newClassInstance("org.apache.pulsar.client.impl.schema.StringSchema")
.newInstance());
} In my case it's replaced by simple |
Beta Was this translation helpful? Give feedback.
-
The slow startup of |
Beta Was this translation helpful? Give feedback.
-
Using the pulsar-admin command can be very frustrating because of the startup time. That's one point were graalVM native image is interesting: build a static "binary".
Various problem to compile to native-image can occur, using reflection and dynamic classloader are often the problems providers. From my point of view, auth plugins are the main problem, but apart of these, do you see any points to look at?
Beta Was this translation helpful? Give feedback.
All reactions