Java
- Java 24 to Reduce Object Header Size and Save Memorywww.infoq.com Java 24 to Reduce Object Header Size and Save Memory
JEP 450 (Compact Object Headers) has been targeted for delivery in JDK 24. This currently experimental feature optimizes heap utilization by shrinking the size of the mandatory object header in HotSpot. This should reduce overall heap size, improve density of deployments, and increase data locality.
- Java on Kubernetes
YouTube Video
Click to view this content.
Not a lot of information out there about running Java on k8s
I have also been looking into benchmarks between HTTP servers.
There is this but its just "Hello world"
- Containerize your Java applicationslearn.microsoft.com Containerize your Java applications - Java on Azure
This article provides an overview of recommended strategies for containerizing your Java applications.
Even though I don't use Azure, I found this quite interesting.
- YYYY? yyyy!pvs-studio.com YYYY? yyyy!
Do you know what′s the difference between the ′Y′ and ′y′ characters in the Java date pattern? In this article, we′ll explore how an incorrect date format can cause an error. We′ll also introduce our...
- Need help with Networking homework. FTP program using UDP.
So I am working on a homework project for my network architure class were I have to devlop an FTP program using UDP (not TCP). I was able to get my GET and PUT functions to send a 21byte test file and it worked. However when I tried to do a 1MB file the program hanged and did not send all of the data. I need to be able to send files of 1MB, 25MB, 50MB, and 100MB. Here is my code.
GET (Client Side)
``` private static void getFile(String serverFilePath, String clientFilePath) throws IOException { clientFilePath = clientFilePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!clientFilePath.startsWith("/")) clientFilePath = currentDir + "/" + clientFilePath;
sendMessage("GET " + serverFilePath);
//Write file to client try (FileOutputStream fos = new FileOutputStream(clientFilePath)) { while (true) { byte[] buffer = new byte[BUFFER_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, buffer.length); socket.receive(packet);
String data = new String(packet.getData(), 0, packet.getLength()); if (data.equals("DONE")) break;
fos.write(packet.getData(), 0, packet.getLength()); } } System.out.println("[Client] File downloaded successfully."); }
PUT (Client Side)
private static void putFile(String clientFilePath, String serverFilePath) throws IOException { clientFilePath = clientFilePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!clientFilePath.startsWith("/")) clientFilePath = currentDir + "/" + clientFilePath;sendMessage("PUT " + serverFilePath);
//Upload file to server try (FileInputStream fis = new FileInputStream(clientFilePath)) { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead; while ((bytesRead = fis.read(buffer)) != -1) { DatagramPacket packet = new DatagramPacket(buffer, bytesRead, serverAddress, SERVER_PORT); socket.send(packet); } sendMessage("DONE"); } System.out.println("[Client] File uploaded successfully."); } ```
GET (Server Side) ``` private static void handleGet(String filePath, InetAddress clientAddress, int clientPort) throws IOException { filePath = filePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!filePath.startsWith("/")) filePath = currentDir + "/" + filePath;
//Check is file exists File file = new File(filePath); if (!file.exists()) { sendMessage("[Server] Error File not found", clientAddress, clientPort); return; }
//Write file to server try (FileInputStream fis = new FileInputStream(file)) { byte[] buffer = new byte[BUFFER_SIZE]; int bytesRead; while ((bytesRead = fis.read(buffer)) != -1) { DatagramPacket packet = new DatagramPacket(buffer, bytesRead, clientAddress, clientPort); socket.send(packet); } sendMessage("DONE", clientAddress, clientPort); } } ```
PUT (Server Side) ``` private static void handlePut(String filePath, InetAddress clientAddress, int clientPort) throws IOException { filePath = filePath.replaceAll("^\"|\"$", ""); //Strip quotes if any. if(!filePath.startsWith("/")) filePath = currentDir + "/" + filePath;
File file = new File(filePath); try (FileOutputStream fos = new FileOutputStream(file)) { while (true) { byte[] buffer = new byte[BUFFER_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, buffer.length); socket.receive(packet);
String data = new String(packet.getData(), 0, packet.getLength()); if (data.equals("DONE")) break;
fos.write(packet.getData(), 0, packet.getLength()); } } sendMessage("DONE", clientAddress, clientPort); } ```
- 25 Reasons Why Financial Enterprise Companies Use Javadigma.ai 25 Reasons Why Financial Enterprise Companies Use Java - Digma
I’ve been a Java developer for almost two decades, and one thing has stood out...
- How to profile a performance issue using Spring Boot profiling toolsfoojay.io How to profile a performance issue using Spring Boot profiling tools
Profiling performance issues and establishing robust monitoring and observability are critical for maintaining the health and efficiency of your Spring Boot application.
- Guide to Java authentication and authorization | Cerboswww.cerbos.dev Guide to Java authentication and authorization | Cerbos
Authorization technologies have seen significant changes and advancements in recent years—especially when it comes to Java. This article provides an overview of the evolving landscape to help you choose the best authorization framework for your Java application.
- [Question] How make sure that the scheduler does not run on holiday
Hey Guys,
For my current spring boot project I have been using a
@Scheduled
annotation and using cron syntax for running jobs, but now I don't want to schedule jobs on holiday (based on US calendar).So is there any approach to skip the schedule on holiday.
Thanks for your help in advanced.
- Embracing Reactive Applications on JVM: a Deep Dive into Modern I/O Models and Vert.xwww.infoq.com Embracing Reactive Applications on JVM: a Deep Dive into Modern I/O Models and Vert.x
This article discusses the shift from blocking to non-blocking and asynchronous I/O models, highlighting their role in modern software development. It focuses on Vert.x, a toolkit for building reactive applications on the JVM, featuring the Multi-Reactor Pattern, Event Bus, and Verticles. Vert.x is ...
- How Indexing Enhances Query Performancedigma.ai How Indexing Enhances Query Performance - Digma
The importance of indexes in optimizing database performance When managing a database, speed and efficiency...
cross-posted from: https://programming.dev/post/19544005
> When managing a database, speed and efficiency are crucial. As applications handle more data and become more complex, the performance of database queries plays a big role in keeping everything running smoothly. One of the best ways to make queries faster is by using indexes. Similar to a book’s index that helps you quickly find a topic, database indexes allow you to find specific data without searching through the entire database. This article explains the basics of indexing, how it improves query performance, and some simple tips for using indexes effectively. Whether your database is small or large, understanding how to use indexes can help keep your application fast and responsive.
- Java News Roundup: Class-File API, GlassFish, JHipster, JReleaser, Hibernate Search, Micronautwww.infoq.com Java News Roundup: Class-File API, GlassFish, JHipster, JReleaser, Hibernate Search, Micronaut
This week's Java roundup for August 26th, 2024, features news highlighting: JEP 484, Class-File API, promoted to Candidate status, GlassFish 7.0.17, JHipster 8.7.0, JReleaser 1.14.0, Hibernate Search 7.1.2 and 7.2.1, and Micronaut Framework 4.6.0.
- What is the best way to learn Spring boot?
Hey guys, I'm pretty new to coding and I recently learnt java and now I have to learn spring boot but there are a lot of sources when searched and it's getting quite complicated.
So is there any documentation which can help me learn spring boot.
Also thank you for all the help.
- What is the alternative option for "Only use private JDK runtimes" in newer versions of Launch4j?
YouTube Video
Click to view this content.
Like you can see in the linked youtube video (forward to 7:14), he is using an older version of Launch4j and using "Only use private JDK runtimes" in the JRE tab to make sure the .exe file uses the JRE we bundled along with other necessary files. But the latest version I am using (3.5.0) does not have that option.
What is the alternative option for the newer versions of Launch4j?
- Ktor vs. Spring Boot: 5 Key Differences for Kotlin Devsdigma.ai Ktor vs. Spring Boot: 5 Key Differences for Kotlin Devs - Digma
The key differences between Ktor and Spring Boot for Kotlin developers such as performance , Async work/thread, ecosystem, DevEx,, observability
cross-posted from: https://programming.dev/post/17309619
> In this article, we will explore the key differences between Ktor and Spring Boot for Kotlin developers based on the experience of various developers.
- Creating Asynchronous Applications with Virtual Threads Venkat Subramaniam BackEnd
YouTube Video
Click to view this content.
- Continuations: The magic behind virtual threads in Java by Balkrishna Rawool @ Spring I/O 2024
YouTube Video
Click to view this content.
- Shorten your feedback loop: Java observability with OpenTelemetry, Grafana Cloud, and Digma.ai
cross-posted from: https://programming.dev/post/15919674
> https://grafana.com/blog/2024/06/21/shorten-your-feedback-loop-java-observability-with-opentelemetry-grafana-cloud-and-digma.ai/
- Virtual vs Platform Threads When blocking operations return too fastdavidvlijmincx.com Virtual vs Platform Threads When blocking operations return too fast
In this post, I look at Virtual Threads and if they are a silver bullet for blocking tasks.
- Efficient containers with Spring Boot 3, Java 21 and CDS by Sébastien Deleuze @ Spring I/O 2024
YouTube Video
Click to view this content.
- A list of major Java and JVM features since JDK 17 to 22digma.ai A list of major Java and JVM features since JDK 17 to 22
A list of Java and JVM features from JDK 17 to 22, including new language features, API changes, security updates, documentation, deprecations.
cross-posted from: https://programming.dev/post/15638499
> A list of major Java and JVM features since JDK 17 to 22, > > New language features > JEP-409: Sealed Classes (17) > JEP-440: Record patterns (21) > JEP-441: Pattern matching for switch (21) > JEP 456: Unnamed Variables & Patterns (22) > > API changes > JEP-306: Restore Always-Strict Floating-Point Semantics(17) > JEP-382: New macOS Rendering Pipeline(17) > JEP-400: UTF-8 by Default (18) > JDK-8301226 – Clamp method for java.lang.(Strict)Math (21) > JEP-439: Generational ZGC > JEP-444: Virtual threads (21) > JEP-454: Foreign Function & Memory(FFM) API (22) > > Security > JEP-452: Key Encapsulation Mechanism API (21) > JDK-8275252: keystore file > Features > JEP-408: Simple web server (18) > JEP-423: Region pinning for G1 (22) > JEP-458: multi-file source-code programs (22) > JEP-423: Region pinning for G1 (22) > JEP-458: multi-file source-code programs (22) > > Documentation > JEP-413: Javadoc code snippets (18) > > Deprecations > > Lookahead > Scoped values + Structured concurrency > Module import declarations
- Oracle Java police start knocking on Fortune 200's doors for first timewww.theregister.com Fortune 100 get Java audit letters for the first time
Expansion of compliance activity follows per-employee licensing change
- Welcome to the Leyden Prototype Repo!github.com leyden/README.md at premain · openjdk/leyden
https://openjdk.org/projects/leyden. Contribute to openjdk/leyden development by creating an account on GitHub.
- [Question] Are there any (simple) open source java projects I can study to better my understanding of real world code?
I teach a course in java and springboot for beginners. I would like to walk my students through the code of a real world java or springboot application. Can anyone recommend a good example?
- JIT vs AOT compilationbell-sw.com JIT vs AOT compilation
Learn about two approaches to compiling Java applications, their benefits for performance and drawbacks.
- [Question] Why does Auth0 allow for direct usage of social logins, but with Keycloak I have to register my app at each Identity Provider first?
https://lemm.ee/post/29785400
> So I'm making a project in SpringBoot with Oauth security. > > If I use Auth0 as my Authorization Server, I can register an application there and just say that I want user to be able to login with Google an Facebook. That's all it takes. > > If I use Keycloak as my Authorization Server, I can also have users choose Google or Facebook as there prefered login, but in order to provide that, I have to register my app with Google and Facebook first. > > So how come it's so easy with Auth0 and a little less easy with Keycloak? Is it a contract thing, does Auth0 have contracts with all these providers or something?
- Fix Broken Tests Quicklyappmap.io Fix Broken Tests Quickly
Optimize for open graph: AppMap Test Failure Report identifies test failures, guiding fixes efficiently. Simplifies debugging, enhancing code quality.
- Why is OpenTelemetry important for Java applicationsdigma.ai Why is OpenTelemetry important for Java applications - Digma
When discussing Observability, OpenTelemetry is crucial because it enables organizations to understand the internal state of their systems...
- Java Annotated Monthly – April 2024blog.jetbrains.com Java Annotated Monthly – April 2024 | The IntelliJ IDEA Blog
Welcome to this month’s Java Annotated Monthly, where we’ll cover the most prominent updates, news, and releases in March. This edition is truly special because it introduces a new section – Featured
- 44 Tools, Plugins and Libraries to Get Started with Your First Java Spring/Quarkus Appdigma.ai 44 Tools, Plugins and Libraries to Get Started with Your First Java Spring/Quarkus App
In this article, I will share a list of tools, plugins and libraries to get started with your first Java Spring/Quarkus application and explain what they are.
- How to Detect and Prevent Anti-Patterns in Software Developmentdigma.ai How to Detect and Prevent Anti-Patterns in Software Development Digma
How to detect and prevent Anti-Patterns in Software Development using pair programming, code reviews, Continuous Feedback and observability.
In this blog post, we will explore how to detect and prevent these anti-patterns using pair programming, code reviews, and observability.
- OpenJDK Project Wakefield - The Wayland Desktop for JDK on Linux
YouTube Video
Click to view this content.
- How to Detect Cache Misses Using Observabilitydigma.ai How to Detect Cache Misses Using Observability - Digma
In this article, we'll examine cache misses using observability, learn about the caching concept and how to implement it in Spring Boot.
cross-posted from: https://programming.dev/post/11703178
> In this article, we’ll examine cache misses and, in general, learn about the caching concept and how to implement it in Spring Boot.