You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by Omar Al-Safi <om...@oalsafi.com> on 2021/03/23 12:16:01 UTC

[DISCUSS] Spring Native support for camel-spring-boot

Hello Camelers,

Currently Spring Native is in the Beta phase
<https://spring.io/blog/2021/03/11/announcing-spring-native-beta>. Since it
is already in Beta, I thought it would be nice to explore how this can be
integrated into camel-spring-boot when it is officially released.

Currently, you can actually already compile and run an existing using
camel-spring-boot route using Spring Native AOT plugin and native-image.
However, what it needs to be done, is that, you will need to supply the
type hints that are needed for native-image AOT compiler manually or use
the native-agent to generate hints based on the integration tests.

Moving forward based on my small research, I think it will make sense if
these hints are already included in the camel-spring-boot starters, for
example the included Kafka clients hints
<https://github.com/spring-projects-experimental/spring-native/blob/master/spring-native-configuration/src/main/java/org/springframework/kafka/annotation/KafkaHints.java>
and therefore it will allow seamless experience to compile and run
camel-spring-boot routes natively without supplying any extra type hints
that are related to Camel when running in native mode.

How to do it, here are some options that I could think of (please feel free
to suggest any other ideas):
- Create a maven plugin to camel-spring-boot to generate type hints for
Camel core packages.
- Add needed type hints for each component starter, this is going to be a
manual process, similar to camel-quarkus process.

Another idea is use to native-agent to generate the needed hints for the
AOT compiler during the integration test, although this is the easiest way
to do it, however it can be unreliable due to the fact that
integration tests may not cover all the aspects of the components and thus
missing important info that needed for the AOT compiler.


What do you think? Any other ideas?


Regards,
-- 
Omar Al-Safi
oalsafi@apache.org
https://blog.oalsafi.com

Re: [DISCUSS] Spring Native support for camel-spring-boot

Posted by Zheng Feng <zf...@redhat.com>.
I did some work to compare the performance of Camel Quarkus and Spring
native one months ago. see [1] and I agree that the easiest way is to use
the native-agent to generate the native configuration files.


[1]
https://zhfeng.github.io/2021/02/04/comparison-camel-quarkus-and-camel-spring-boot-graalvm-native.html

On Tue, Mar 23, 2021 at 8:22 PM Omar Al-Safi <om...@oalsafi.com> wrote:

> Hello Camelers,
>
> Currently Spring Native is in the Beta phase
> <https://spring.io/blog/2021/03/11/announcing-spring-native-beta>. Since
> it
> is already in Beta, I thought it would be nice to explore how this can be
> integrated into camel-spring-boot when it is officially released.
>
> Currently, you can actually already compile and run an existing using
> camel-spring-boot route using Spring Native AOT plugin and native-image.
> However, what it needs to be done, is that, you will need to supply the
> type hints that are needed for native-image AOT compiler manually or use
> the native-agent to generate hints based on the integration tests.
>
> Moving forward based on my small research, I think it will make sense if
> these hints are already included in the camel-spring-boot starters, for
> example the included Kafka clients hints
> <
> https://github.com/spring-projects-experimental/spring-native/blob/master/spring-native-configuration/src/main/java/org/springframework/kafka/annotation/KafkaHints.java
> >
> and therefore it will allow seamless experience to compile and run
> camel-spring-boot routes natively without supplying any extra type hints
> that are related to Camel when running in native mode.
>
> How to do it, here are some options that I could think of (please feel free
> to suggest any other ideas):
> - Create a maven plugin to camel-spring-boot to generate type hints for
> Camel core packages.
> - Add needed type hints for each component starter, this is going to be a
> manual process, similar to camel-quarkus process.
>
> Another idea is use to native-agent to generate the needed hints for the
> AOT compiler during the integration test, although this is the easiest way
> to do it, however it can be unreliable due to the fact that
> integration tests may not cover all the aspects of the components and thus
> missing important info that needed for the AOT compiler.
>
>
> What do you think? Any other ideas?
>
>
> Regards,
> --
> Omar Al-Safi
> oalsafi@apache.org
> https://blog.oalsafi.com
>