Skip to content

Instantly share code, notes, and snippets.

View snicoll's full-sized avatar
🍃
👨‍💻

Stéphane Nicoll snicoll

🍃
👨‍💻
View GitHub Profile

Merci à toutes et tous, c'était bien chouette!

Le repo: https://github.com/snicoll/ops-status

Comme quelqu'un me l'a fait remarquer, il n'y pas eu de séance de questions/réponses à l'amphi, donc je me suis dit que j'allais essayer de vous faire un résumé de mes discussions.

Un petit retour sur les "slice tests": https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testing.spring-boot-applications.autoconfigured-tests

RestClient vs. RestTemplate dans le contexte de Loom (Virtual Threads) et de l'importance de préciser que RestClient reste une interface moderne au-dessus de RestTemplate et n'est pas une contrainte pour bénéficier de Loom. Donc si vous voulez utiliser Loom, RestTemplate ou RestClient, peu importe mais RestClient offre une interface plus moderne. Je précise aussi que nous avons appliqué un peu de modernisme à JdbcTemplate aussi, avec JdbcClient: https://docs.spring.io/spring-framework/reference/data-access/jdbc/core.html#jdbc-JdbcClient

This file has been truncated, but you can view the full file.
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483547
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147482647
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483547
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147482647
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdow

Current status

Single module with Cloud Native Buildpacks

mvn spring-boot:build-image -Pnative

This works, even if the Spring Boot Maven Plugin nor the Native Build Tools Plugin have been applied in the project as the native profile brings them.

***************************
APPLICATION FAILED TO START
***************************
Description:
package com.example.custominitializr.generator.contributor;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import io.spring.initializr.generator.io.template.MustacheTemplateRenderer;
import io.spring.initializr.generator.project.ResolvedProjectDescription;
This file has been truncated, but you can view the full file.
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
This file has been truncated, but you can view the full file.
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
@snicoll
snicoll / bytecode
Last active January 15, 2019 21:45
// ================com/example/demo/MyProperties.class =================
// class version 50.0 (50)
// access flags 0x31
public final class com/example/demo/MyProperties {
// access flags 0x12
private final Ljava/lang/String; foo
@Lorg/jetbrains/annotations/NotNull;() // invisible
Caused by: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.naming.internal.VersionHelper12.getContextClassLoader(VersionHelper12.java:185)
at com.sun.naming.internal.ResourceManager.getFactory(ResourceManager.java:426)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:592)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:550)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:345)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate.lambda$lookup$0(JndiTemplate.java:156)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:91)
@snicoll
snicoll / keycloack.md
Last active April 14, 2017 08:36
Keycloack Auto-configuration brain dump

Here is a proposal based on a quick overview of the code with, I hope, enough explanations so that it makes sense.

Spring Boot adapter

The keycloak-spring-boot-adapter is the code that holds the auto-configuration as far as I can see so it would be nicer to name it that way. I'd suggest keycloack-spring-boot-autoconfigure but it's really not important.

KeycloakSpringBootConfiguration should be renamed to KeycloakAutoConfiguration

What is important is that rather than taking dependencies and patching them in a shaded jar at that level, you should take that decision in the starter, leaving all that business out of the autoconfigure module. Here is what I suggests: