[VV75] blocking vs non-blocking, Spring AI, IntelliJ, dev future, exceptions, clean code, OpenTelemetry, GenAI, Jakarta EE 10
This week, Thursday and Friday was the first week of the Java Champions conference. I assisted in several talks, and here are my notes on some of them.
?? blocking vs non-blocking
In this talk, Bazlur Rahman gives intel on virtual threads that empower thread concurrency (you can run millions on thread now).
virtual threads diagram
banking teller analogy
???? Spring AI
In this talk, Craig Walls explains how to use the Spring AI starter to interact with AI (like Open AI) from Spring Boot. Below is a sample of the code to dial with Open AI.
Simplest way:
import org.springframework.ai.chat.ChatClient;
//...
private final ChatClient chatClient;
public JokeController(ChatClient chatClient) {
this.chatClient = chatClient;
}
@GetMapping("/joke")
public JokeResponse tellJoke(@RequestParam("subject") String subject) {
return chatClient.call("Tell me a joke about "+ subject);
}
???? IntelliJ
In this talk, Anton Arhipov gives tips to strengthen your IntelliJ productivity: for example, postfix completion, and code folding...
?? future of dev
In this talk, Holly Cummins presents the evolution of programming and how to feel towards AI in the next years...
1) garbage collection users were more likely to complete the task in the time available, and those who did so required only about a third as much time (4 hours vs. 12 hours)
2) the risk of error is lower as we get low on the stack
3) will AI take our job: NO
?? we switch each time to new ways: transistor networks??machine codes??assembler??high-level languages??librairies??framewroks??ai
and the developer population grew each time??
4) the productivity will be higher
???expect the unexpected
In this talk, Kito Mann guide us in the way to handle exceptions.
1) don't eat your exception; catch it, log it, and tell the user
2) if you can't recover it, don't catch it
3) Throw meaningful exceptions: set a message, use a relevant exception type
4) SpringBoot: ErrorController to centralize exception handling
领英推荐
???? Clean code, really worth it?
In his talk, Jonathan Vila tells us the story of Kleen (a clean developer) who fights Poorqe (the dirty code monster), and how to weaponize us to fight such monsters in our daily work.
1) cost of poor quality code: 2 trillion dollars in the US, 4 days a month by developer on fixing errors
2) fixing bugs is 607Billion dollars,
3) clean code principles:
4) most detected issues:
5)security: https://cheatsheetseries.owasp.org
6) Tools: PMD, sonarlint, checkstyle, sonarqube, findbugs
SonarLint and a pre-commit git hook ftw
Code is going to die, after 5 years only 37% of old code remains, so do not remove all today but clean as you walk!
?? Observability with OpenTelemetry
In this talk, Christopher Judd shows us how observability is done with Opentelemetry and how to face the challenge of distributed tracing.
1) short name: o11y
2) idea: like a doctor checking external signals to understand internal issues
3) Twitter pillars: monitoring, alerting/Visualization, Distributed Systems Tracing Infrastructure, Log Aggregation/Analytics
4) telemetry definition: get remotely information from equipment
5) opentelemetry
6) Distributed tracing is done with a correlation id
7) In the demo, I saw the outputs in the spring boot logs, then in a GUI done by Zipkin (which looks like the network tab of the chrome dev console with the horizontal bars)
?? Gen AI
In her talk, Mary Grygleski explains the history of AI and details how to try out vector search: an efficient manner to make AI.
1) GPT means Generative Pre-Training, it takes prompts and then does pattern matching to output an answer to questions for the prompt
2) Vector search is a way to find related objects that have similar characteristics using machine learning models that detect semantic relationships between objects in an index.
? Jakarta EE 10
Josh Juneau shows us the last features of Jakarta EE 10 and how to migrate to this fresh new version.
1) Java SE 17 support, support for Java SE 21 will be in the next version
2) JsonPointer
// change a value
JsonPointer namePointer = Json.createPointer("/name");
JsonString name = Json.createValue("Bill Nye");
jsonStructure = namePointer.replace(jsonStructure, name);
System.out.println(jsonStructure);
?? Java champion jokes
?? I asked a Java champion how he became a Java champion, and he said he gave a few classes.
? I asked a Java champion how she was so fast at coding, and she said she had a lot of coffee.
?? I asked a Java champion how tough is it to reach that level, and the champion said it requires to code every day without exceptions.