I tried some time ago to create a native image for the cli. It’s a bit cumbersome since Pulsar and the underlying tech stack uses a lot of reflection, that must be declared at build time.
c
Chris Bono
09/14/2023, 2:18 PM
I am assuming you are talking from the client perspective. If so and you are using Spring for Apache Pulsar, it supports GraalVM native images.
Disclaimer: I work on Spring for Apache Pulsar and am not trying to bias or ‘sell anything’.
Chris Bono
09/14/2023, 2:19 PM
This of course would assume you are using Spring etc… Even if you don’t use it, you may want to look into the RuntimeHints we have created to get an idea what we had to configure to make it run through the GraalVM grinder successfully.
a
Alex Katebi
09/14/2023, 7:12 PM
Yes I am using Pulsar client in Spring Boot. So Pulsar Client JAR should compile to native image without a problem. Thanks for the reply!
c
Chris Bono
09/15/2023, 5:39 AM
You will have to specify many hints to do so. You can peek into the spring pulsar repo to see what we had to do