ISTA Conference 2025

Bootful Spring Applications

36:13 · 16 Oct 2025 · YouTube

About this talk

In this talk, the speaker, a Spring developer advocate, discusses the integration of artificial intelligence with Java and Spring frameworks, particularly through the new Spring AI project. He shares insights into the challenges of AI projects, emphasizing that many fail when attempting to translate existing business logic from Java to Python. The speaker demonstrates how to build a dog adoption application using Spring AI, showcasing how it leverages a vector store for better data interactions. He explains the importance of using Java for such projects due to its performance and security advantages, and he walks through creating a conversational AI system to help with dog adoptions. The session also highlights the new features in Java 25, including virtual threads and other enhancements aimed at improving application scalability and efficiency.

Full transcript

Oh, hi everybody. Hello. Hi. Hi. Come on in. Have a seat. Look, I'm so glad we're all here together. I appreciate that. Uh, my name is Josh. I work on the Spring team. I'm a Spring developer advocate, uh, Java Champion, Cotlin Google Developer Expert, and a Microsoft MVP. That last one very confusing and surprising to me as well because but anyway, yeah, and uh look, we all

do things that we're not proud of. I am a YouTuber. So, if you want to join me on YouTube, you can, you know, uh that's a it's a it's it's an okay channel. It's not the best. It's not the worst. It's okay. There's a LinkedIn, there's Twitter and code, okay? So, you can follow along later on when and if you have questions. But the code is useful

and uh the Twitter is useful because you know it'll help you contextualize what we do here right now. It's good to remember what we do here right now and what I've done here in this wonderful wonderful city. You know I like to take I like to have memories of that. I have been here before. I've been here a few times uh before. Here's here's a here's a

photo I took with Jeanclaude Vanam back in 2011 here in Sophia. And you can see I'm wearing a a spring spring shirt. And there he is right there. Right. And uh this is from 2011. And so there's some things that are very interesting about this. First of all, you saw the date. Look how nice that photo is. And you can see what it says up there in

the text, right? It says happy village tavern which I think is very interesting. You have to be happy when you are there. That's a fact. Okay, it's a it's the law. And so I am happy because I've had Rakia. Okay, Rakia makes you happy. But this guy not happy. Okay, this is the the bodyguard. I think he's got bad ideas and so he's not happy. So anyway,

that was a that was that was 2011 and every single time I've come here, I've had a great time, right? And it's not just because of Rakia. It's because of this wonderful wonderful community. So I'm I'm really happy to be here and I'm really happy to talk about the latest and the greatest of the stuff that we're working on in the wonderful world of Spring. And um

you know, I have so much I want to show you. I want to show you some of the stuff we're working on in Spring AI. How many of you have built anything with AI? I think this is a wonderful opportunity for us in the Java community because right now most of the business logic, most of the services, most of the data that people build in the world

is in Java and Spring and it's very natural to extend all of that to have uh integrations with AI. Uh and I think that would be a really easy way to get more success. There was a study from MIT just a few months ago and that study said that something like 90% of all AI projects fail. Why? Right? And I think I know why. I think I

understand why. What they're trying to do is to take the domain, the business logic, the the the institutional knowledge that they have built up over many years in Java and in Spring and they're trying to translate it into Python to build these AI integrations. This is a terrible idea. No wonder it's going to fail, right? Because you have to rebuild all this. Why? Why bother doing this?

Instead, just build it in the JVM. The JVM is faster. It's more secure. It's more performant. It's just a much better place to build these kinds of services and solutions. So, what I want to show you today is something that takes advantage of this project called Spring AI, which we g it went GA. It went public. It went it went uh uh final version uh for 1.0

back in May of this year. Okay, Spring AI is really, really powerful. Now, what are we going to build? That's the other question, right? We can't just build nothing. We have to have an idea. We have to have something that we can think about. So, what I want to do is I want to build something that is relatable. And if you know much about Spring, then you

know about the Spring Pet Clinic, right? The Spring Pet Clinic is a sample application from many years ago, right? But it still gets updated. You can see it was updated here 2 days ago. There's even a whole spring pet clinic GitHub organization with many different repositories, right? So these repositories show different implementations in the pet clinic and they're all about animals, dogs, cats, you know, these kinds

of things. Who has a pet? Okay, good. And the rest of you probably probably the pet has you, right? It's the other way around, right? Either way, I love I love all I love dogs. I love cats. I love almost almost all of them. Okay. Almost almost all of them. Not not all of them. My dog is terrible. The worst dog. I have a dog. His name

is Peanut. Peanut is the worst. He's just a He's not a good dog. A bad boy. Not a good dog. But we keep him for three simple reasons. Three simple reasons. One is even terrible, terrible dogs deserve love. Okay? So, we give him love and he's a good, you know, we love him, but we just don't like him. You know, the there's a difference there, right? He's

family, but he's he's evil. You know what I'm saying? Um uh and so that's one. Two is ego. Okay. In my home, I have my my my my partner and we have our daughter and uh both of them speak five languages. I only speak three and a half. So if we did not have the stupid dog then I would be the stupidest cannot have this cannot have

this. So we keep the dog for this reason. And then finally finally just being very honest with you here. Uh he is very very cute. Right. I Yeah. I know. So cute. So so cute but Okay. Pure evil. Not a not a good dog. Malevolent. Right. Oh yeah. All right. Thank Come on. Do the thing. All right. Thank you. Pure evil dog. Not a good dog. And

so I think about my evil dog a lot. I have another there's I learned about another evil dog many years ago during the COVID pandemic whose name is Prancer. And Prancer, the the woman that had Prancer at the time. She put this dog up for adoption back in 2021. And she described this dog very very funny, you know, very very funny. He says, "I have tried to

for the last several months to post this dog for adoption and make them sound palatable. The problem is he's just not. There's not a very big market for neurotic, man-hating, animal-hating, childrenhating dogs that look like gremlins, right?" So, who says these things about a dog? It's slander. You know, it's doggy slander. And she says, "I have to believe there's someone out there for prancer because I am

tired and so is my family." Every day we live in the grips of the demonic chihuahua hellscape that he has created in our home. She continues, "He was quiet and just laid on the couch. He did not bother anyone. I was excited to see him come out of his shell and become a real dog. I'm convinced at this point that he's not a real dog, but more

like a vessel for a traumatized Victorian child that now haunts our home." What? What? This dog. Poor dog. Oh, I mean, I feel bad. But she continues, uh, she continues, "We already addressed the men and children situation. If you have people over, he would have to be put away like he's a vacuum. I know finding someone who wants a Chucky doll in a dog's body is hard,

but I have to try." And then she signs off and she says, "Oh, he's only 2 years old and will probably live to be 21 through pure spite." So, take that into account, right? So, it doesn't sound like a fun dog, but but still also very cute. I would I would I would totally pet this dog. That's a I would pet that dog. I might lose a

finger, but I would pet that dog. I can see why, you know. So, I think about these terrible dogs a lot. My terrible dog, Peanut, and this terrible dog, Prancer. And I want to build something to help adopt them. So, what we're going to do is we're going to go here to my second favorite place on the internet, start.spring.io. And what we're going to do is we're

going to build a new service and we're going to call this assistant. Okay? And we have some selections that we have to make. What version of Java do you want to use? We have three choices but only one valid choice. Okay? Java 25 is the current version of Java. These other choices, we only keep them here so that we can know who makes terrible, terrible life decisions.

Okay? You should never ever select these versions. These are completely old and long since irrelevant. So, we have Java 25. By the way, Java 25 has one of my favorite features. One of my favorite features. Look at this. This is it's it's finally happened. Okay, the unthinkable has happened. I'm going to create a Watch this. I'll just going to open this up. Okay, and I'll say void

main. Okay, and I'll say IO.print line. Hi. Uh, okay. Hi. I don't know. Hello world. Okay, like that. And then run this. And I'm going to say JavaScript Java. Okay. And there you go. There is my script written in Java. Right? You know what that is? This is the first good JavaScript. >> It's never happened before. It's never happened. This is it. Finally. Finally, after 30 years.

30 years. I'm so excited. Right. And and it can get it gets better. You can actually fix this. So if I go over here, script. Java. And then I go over here and I say I want to go back over here and I'm going to give it this. I'll say user bin env. Okay. And I'll just move this to another. I'll just say hi. And I'll say

uh uh uh hi. And then hi. Right. And now I've got an executable JavaScript. The the first and only good kind of JavaScript. Okay. again an amazing time. So Java 25 is amazing for this and for other reasons. Okay, so I'm going to use Java 25 and we need some Gravium native image support. We need the web support. We need to do vector store, right? I'm going

to use PG vector store. I'm going to be using Spring Data JDBC to talk to the database. I'm going to use the web server support. I've got that. I've got uh data JDBC. I've got that. I need chat memory, right? And I need a AI model. And Spring AI supports dozens of different AI models. I'll use Open AI. You can use Olama. You can use Gemini. You

can use I mean dozens. There's like 20 or more different models, right? So, I'll use that. Um, and I think Oh, we also have the vector store. We've got this. Um, oh, you know what else we want? MCP client support. Okay, I think I'm happy with that. Let's hit generate. And I'm going to open this up. And I have an alias here. That's an alias to, yes,

another JavaScript, right? So, I'm going to use this JavaScript to open this zip file that I have here. So, UAO assistant.zip. That'll run unzip and it'll c into the directory and it'll open up my IDE for me. Okay, again, JavaScript. Very nice. So, I have a database already running in my local machine. Can you see this font all the way in the back there? Okay, good. So,

Spring data source password is secret. Don't tell anybody that. Okay, it's our secret. my user and then the URL is JDBC colon PostgresQL localhost my database. Okay, let's just let's try this out. I'll click on that. Hit test connection. Hit apply. Hit okay. Go over here. Refresh. Right. Hit that. Go there. Tables there. Okay. So, all I've got right now, let's drop these two uh things right

here. Object actions. Drop. Okay. I'm going to just say drop if exists. Who cares? Go. And now I've only got this one table called dog. And you can see that this table, here's our buddy Prancer, right? His ID is 45. His name is Prancer. And he's described as a demonic, neurotic, man-hat-hitting, animal-hating, children-hating dog that looks like a gremlin. Okay? So, we want to support adopting this

terrible, terrible dog. So, what we shall do is build a service to help people find the dogs of their dreams or nightmares at this dog adoption shelter called Pooch Palace. Okay. Pooch Palace. Here we are. Okay, let me make that font a little bit bigger. There we go. So, class assistant controller and it'll be at controller at responsebody. And what we're going to do is we're going

to use the Spring framework chat client. Okay, this chat client is your one-stop shop for all your AI needs. Now, this code is really good. It's really good. It was written by the smartest people. Okay, only the best people worked worked on this code. Okay. And by the way, this is he is a he's Bulgarian by the way, the second most uh the second, you know, founder

of the Spring AI project is Christian Solaf. Anyway, so there's this uh we will now create a simple endpoint to answer questions about the dogs that are in the shelter. Okay, so string question and we'll respond with uh a response from the AI model. We'll send a user prompt. That's the question here. We're going to make a call and we'll get the contents back as a string.

Okay, now I have open AI configured. I have to specify an open AI key, right? But I've already done this off of when I before I got on the stage, I set up an environment variable like this. And so that is being used. But I have to specify an open AI key. So do you. Okay, let's try it out. Let's just make sure everything is working. 8080/ask

question equals my name is Josh. Okay, let's see if that works, right? Hopefully everything is going to be just fine. Look, nice to meet you, Josh. We're friends, right? We're connected. It's It's going so well. Let's try this out. What do you think? Uh, let's just see. You know, you you know, trust but verify, right? So, let's see. What's my name? It's going to be fine. Don't

worry about it. Don't worry. It's okay. Hey, I'm sorry, but I don't have your information. Why? You see, this happens to me a lot. I talk to people and then they immediately forget me. Why? I don't know what happened here. But what's happening? This is an API. It is stateless. So we have to give it memory. We have to tell it what has happened. So we need

to take note of every single request that's been sent to the AI model, write it down, store it somewhere like a database and then send it on the each request so that the model can see what we have said. Okay. So what we're going to do is we're going to use an advisor. Advisor filters that process they intercept the requests going to the model. So let's do

that here. I'll say prompt chat memory advisor. Here we are. And I'm going to use there's this right over here. Come on. And we're going to advisor.builder.build. Okay. And then that's going to require I don't want to send all of the messages, just the most recent build, you know, the most recent window of messages, the most recent like 20 messages, let's say. So I need to create

a message window chat memory. I'll pass that in here. And then finally, I want to store everything somewhere. So I'll create a repository. So I'll create that here like that. And I'll pass it in to a data source, right? the SQL data source that we have running in the local machine here as well. So this goes there, this goes here and that goes here. And now I

will tell Spring AI to use that filter when we configure this adi when we configure the client. Okay. So I'm saying default uh advisor chat memory advisor reload and then we ask the question right. So let's say uh oh we have to tell it also where to store everything. I will tell it to create this chat memory table. Okay, here we go. Chat memory initialize schema as

always. And now when I do that, if I go over here, can refresh. There's this new table called Spring AI chat memory. There's nothing in it yet. So let's say my name is Josh. All right, here we go. Refresh. There's our first interaction. Now what's my name? Okay, refresh again. It's got the whole conversation, right? And it knows who I am. It gave me the response. It

says, "Your name is Josh." Right? So, we've given our AI model memory, but the problem is it's still just an open endpoint going straight to my open AI account. You can do anything with it. You can ask it for help with your history homework, right? This is not going to help adopt dogs. I want to adopt dogs, right? So, what we need to do is to give

it a mission. We have to tell it, hey, you're supposed to do just this one thing. And the way you do that is by giving it a system prompt. Now, I have a pre-written system prompt. I will I will go here. talk misk talk uh system prompt and I've got that system prompt and I'm going to wait no no I just realized what I did wrong better

okay now copy and paste this and I'm going to say var system prompt equals paste that in and I'll say the default system is this okay now what this is doing is I'm saying you are an AI powered assistant to help people adopt dogs from the adoption agency called Pooch Palace with locations in Antworp Soul, Tokyo, Singapore, Paris, Mumbai, New Delhi, Barcelona, San Francisco, and London. Did

I say did I say so? Did I say Anwer? I I meant Information about the dogs available will be presented below. If there's no information, then return a plight response suggesting that we don't have any available. Let's try it now. Okay. So, do you have any uh neurotic dogs? Okay. Let's ask. We're trying to find our buddy Okay. I'm sorry, but I don't have any information about

neurotic dogs available for adoption at Pooch Palace. That's the name of our company, right? Our dog shelter. So, it's acting like an employee of our fictitious non-existent dog adoption shelter, but it doesn't have any information. So, we need to give it access to the dogs that are in the database. Okay. And what we're going to do is we're going to take the data in the database and

write it into the vector store. So, let's do that here. I'm going to use spring data JDBC here, string owner and string description. And I'm going to take the data from the SQL database and just, you know, synchronize it with the vector store. Okay. Uh, now I'm using Spring Data JDBC. How many of you are using Spring Data JDBC here? Oh, so good. I love Spring Data

JDBC. And by the way, I also love Java records. I love Java records. I'm a huge fan, right? Big fan. So now let's inject that here. We'll say dog repository. And then we're going to inject the vector store. Okay. Now remember a vector store is a data store optimized for similarity search. Okay. So I want to find similar things. So when the program starts up, I will

go dog repository.findall.for I'm going to get the data in the dogs and I'm going to create a new spring AI document and I'm going to put some regular text. It doesn't matter what text you put as long as you are consistent. Okay, so I also I shall say dog ID dog.name dog.escription and then I shall say vector store.addlist. Document. Okay, this looks pretty good, but there's a

big problem with this. This is a document for dogs. So I shall call it a document. Okay, now let's create a question answer advisor to tell Spring AI to consult the uh the the vector store before it answers any questions. Okay, we want to send only the data that's required to answer the question and no more. So the vector store can help us do some subselection to

prefilter the results. Okay, did I inject that over here? I didn't. I don't think I did. I no I didn't. Here we go. question answer advisor first of all and then we will uh here question answer adviser and what is this issue oh the table doesn't exist either so let's do that we need to create the SQL table for postgres to use it as a vector store

okay reload so the very first time since I'm calling the open AI endpoint to create the embeddings and to write things to the vector store and all this it takes a little while right but I I would never do that normally normally you would write one record and then write to the vector store at the same time, right? Um, so this will take a little while. Let

it finish. And there you go. You you see it took a it took forever this time, right? So I'm now I'm going to comment this out so that it doesn't run next time. Uh, but you can see I've got these tables here, vector store, and here's our 18 dogs including the embedding for Prancer. And embedding is just numbers, right? So I'm going to now uh ask questions

of our AI model. Do you have any neurotic dogs? Let's see what it tells us. Okay. Yes, we do have a neurotic dog available for adoption. Meet Prancer, a demonic neurotic dog who tends to be man-hating, animal-hating, and children hating, right? Uh, he has a unique appearance that resembles a gremlin. So, we found him. We found our dog, the dog of our dreams or, you know, nightmares.

So, what I want to do now is maybe I don't want text. Maybe I want this to be in some form that I can use with my database and other parts of my do domain. So, what I want to do is I'll create a dog adoption suggestion, right? So dog adoption suggestion int id string name right for example just as an example and what I will do

is instead of asking for a string back I'll ask for an entity here we are dog adoptions suggestion and I'll say dog hello dog adoption suggestion and I shall reload this here we go so now I'm gonna ask the same question hello take five good so you can see I get a strongly typed Java object with an int and now I know the record right that's called

structured output mapping you can use that to create responses from the AI that you can then use with the rest of your code now I actually in this case I do want the string text but you should know it's nice and easy to do what I just did okay so let's go over here dotc content now I have found the dog now what right now we have

to adopt this dog we have to pick and take him home right that's a natural next step but we have to schedule this So what we need to do now is integrate our AI with our business logic. Here we integrated the AI with our data. We used a pattern called rag retrieval augmented generation. But I want to integrate it with our data and our business logic. So

I will shall create a patent pending uh dog adoption. Okay, this is a service. It'll be a spring bean and I'll just return a point when you can come and pick up the dog. Okay, so dog ID string dog name and I shall recreate the instant var instant hello instantnow plus three uh days in the future and I'll just return a two string and I'll return that

and I'll say io.print print line adopting dog name. Okay. And then dog ID uh on and then it'll return the time. Okay. Now this is uh 3 days and I need to annotate this as a tool. Now it's very important here to be very clear about what this tool does. This is going to give our AI model agency the ability to interact with our business services. So,

schedule an appointment to pick up a dog from the pooch palace location, right? And I also need to annotate these parameters so that the AI model knows what's expected, the ID of the dog, right? And then same thing over here at tool param, the name of the dog. Okay, now I've done this work, but I need to tell Spring AI that it has this tool that it

can call whenever it wants to answer questions about when it can pick up a dog. So, I shall inject theuler here and I'll say toolsuler and I'll reload. Now, let's try this again. Okay, so uh let me let me delete everything from the chat memory so it doesn't cheat. Okay, goodbye to that. Do you have any inotic dogs? Okay, great. We have an erotic dog. Great. Now,

let's see when we can pick them up. Fantastic. When can I pick up Prancer from the Sophia location? Right, here we go. And it should be 3 days in the future. It is today, the 16th. So, we expect the 19th. Right, there we go. So, we can see that it actually called our business logic. There's our print out confirming that it did so. So, great. This is

good. We've integrated our AI with our business logic and our data. We're already way further ahead than we were just 10, 15 minutes ago. But there is a a problem here, right? This is a a problem I confess I never even heard of. I never even thought about this. Years ago, do you remember years ago the scientists were trying to solve the possibility of the Higs Bzon

particle? Do you remember this in in CERN in Geneva like in 2012? And the scientists, they knew it was possible that this particle existed, but they didn't know where. They didn't know how to prove it, right? And so it was a scientific possibility, but they could not prove it. I think of the same I think that I think the same way about this idea here, which is

what if there's some other language besides Java in Spring. We haven't seen that useful yet. Nobody nobody's building anything interesting in that as far as I'm able to tell. But in theory, it's possible, right? And if that's the case, then how are they going to use this amazing dog adoption service that I wrote here, right? How are they going to repurpose this? How are they going to

reuse this? what we need to do is to extract that out into a service that they can call. Now, I want my AI model to be able to talk to this business logic. So, back in November of last year, do you remember November? I I don't. It's been too long. It's been too long. But back in no November last year, they uh Anthropic created a new specification

called MCP, model context protocol. This specification is a great way to export uh resources, prompts, tools, etc. for your AI models. And we on the Spring AI team were the very we we we built a Java SDK in the weeks after the announcement of the specification. So when you use the MCP SDK today, you're using our code. The official Java SDK is the code that we wrote.

We donated it to the MCP uh effort. So we have a very good integration. Now I will tell you that this was not easy to do. Okay? It took a lot of a lot of hard work to make this happen. So, so here here is Christian Solaf, the co-lead of Spring AI before MCP, right? And this is him after, right? The MCP was a very stressful effort,

very stressful, but nonetheless, we have done it. Okay, so now we have this. Let's go ahead and build an MCP service. Okay, what we're going to do is go back to start.spring.io. Here we go. And we're going to build a new service. We're going to call this scheduler. Okay, and I'll add the model context protocol server support and the web support. I'll hit generate and I'll just

say UAOuler.zip. Here we are. Now, all I'm going to do is I'm going to do something terrible. Something that you should never ever do ever. Not even when you are by yourself at home and no one is watching. I am going to copy and paste code. Okay. So, here we go. And paste. Okay. So, there's that. Oh, forgot the extra parenthesis. Here we go. Get rid of

that. And I'm going to now create a method tool callback provider. And I'll export this logic to uh as a as a uh MCP service. Okay. And there's my tool. And I'll inject that here. Dog adoptionuler and scheduler. Okay. So now it's going to run on port 8081 and it's going to be an MCP service. Now I'm going to refactor this client and I'm going to use

the new service that we built using MCP. Okay. So I'll go over here. uh MCP and I'll say MCPC clients sync HTTP client transport builder HTTP localhost 8081build okay var mcp return mcp now we have mcpin initialize and I'm going to inject this client and use that here instead of the actual localuler object because that doesn't exist anymore does it right we've moved it to a separate

server So, call back new sync and then pass that in there. Okay. So, everything else is basically the same. Now, we do the same exact thing. Let me let me delete the data and look at the answers. Right. Here we go. Okay. Do you have any neurotr Okay, good. Now, uh when can we pick up that dog? H. So, if this is working, it'll go to There

you go. October 9th, 19th, right? And we can see that it called our service in the MCPuler service. Okay. So now we've built an MCP client and an MCP service, integrated them, and we've got them up and running. And I think it's now time to think about getting this amazing code into production. Right? This is the difference between Java and so much of the other languages out

there is that Java is observable. It's secure. It's scalable. It's fast. It's production worthy. Right? We have tools to make this stuff really, really resilient. So what I want to do is first of all for example I want to make this use virtual threads how many of you know about virtual threads in Java right how many of you know about async await in the other JavaScript the

bad kind right yeah async aait is a nightmare it's a bunch of code that you have to add to your code to get non-blocking IO but it it requires you to refactor everything your whole codebase ends up littered with this noise right in Java we don't have this problem we have a nice feature called not called virtual threads and if you want to enable it, you just

do that. Okay, so this is much better. Now, whenever I do IO on the internet with a network socket, if it blocks, this will automatically not block. It'll put it back in the socket and wait and give you the thread back. So, you can actually scale just like you would with Go or Node or whatever, but don't have to refactor your code all like that. So, the

next thing I want to do is I want to make my code fast, right? And remember, Java is super super fast, right? This is much faster than people appreciate. It's also very efficient, right? So here's a a study that the Portuguese did back in 2018 before COVID. Okay, before COVID or BC, right? So here's May 20th, 2018. And the the this study asks what programming languages use

the most electricity, right? And you can see that C is the number one. It uses the least electricity. So it's very good for machines, not for people, right? You've got you've got Rust. Very good. Zerocost abstractions. It's well done. C++ to disgusting. Disgusting. Ah, att 2.0. Okay, so that's pretty good. Top five most energyefficient languages. You want to know where Python is? There there. There. Okay. Not

good. Not good. So, Java already very good. But I also want my code to be fast. This is why it's important to look at something like this. This is the 1BRC challenge. This is a a test to write a program that loads 13 gigabytes of text and does statistics on it instantaneously, as quickly as possible using only the JDK. Well, how long do you think it takes

to do this? 13 gigs of text. The fastest entry, the fastest entries are 1.5 seconds. So, you go down here. Here you go. Look at that. 1.5 seconds to just you hit enter, run, load all the data, do the statistics, and then exit. That takes 1.5 seconds and there's a lot of them that are 1.5 seconds and most of them use GRVM. I love grow VM. Grav

is an AOT ahead of time compiler. But the problem with it is that it takes a little while to compile. So what I like to do is to have elevator music when I play when I do the compilation. I like to have music that plays. And there's a nice plugin here, right? Uh there's a nice plugin that a friend of the community created for us. So we

will plug that into our build over here. And we'll add this to the bottom of the build. Here we are. Okay. Paste that in there. We'll use version 2.0. Okay. Here we go. And I also need to add the GRVM native image plugin as well. Where's that? Start.spring.io. Come on internet. Hello internet. I think I did it for the other one. We can just copy and paste

from here. I hate copying and pasting, but it's what we're doing. Here we go. So, we go over here, paste that in there. Okay, so I've got two plugins, and now I will compile this into a native image, and we'll let the work happen. It takes a little long, a long time to do this native image compilation, but the results are very, very impressive. So, let's just

we'll kick that compilation off. Here we go. It's my favorite part. Wait for it. Wait for it. Okay, good. So, now we've got a native image, right? So if you go to the target directory here, cd target, you've got a native binary that's that's like C code. It's like it's like Rust. It's like C. It's there's no JVM involved anymore. The entire binary. Everything that you need

in the class path and nothing extra. Just the stuff that's required. So the JDK and your class path, but only the required stuff is here. It's in this binary. It's 78 megs of RAM. So let's start it up. Okay. Oh, the port is already in use. Okay. Let's stop this. Go over here. Okay, there you go. So that started up in 33 milliseconds. Okay. So I don't

know how fast your program starts up, but I get I guarantee you it's not that fast. And most importantly, most importantly, you go over here. Here's the Java process identifier, right? Process identifier. I'll go over here. I'm going to measure the RAM in kilobytes. So you divide by a,000. So 77,000 divided by a,000 is 77 megabytes of RAM. Okay? Now again, compare this to look at this.

By the way, notice that I use Safari. You know why? because Google Chrome is garbage. Here we go. Open this up. Ready, steady. I'm gonna open this web page. Here we go. Loading. Loading. Loading. Wait for it. It's coming. It's coming. JavaScript, by the way. The bad kind. Hold. Waiting for Let me just refresh. Maybe that'll go faster. Good thing we got 30 seconds left. Did it

load? There you go. 794 megs of RAM for one stupid JavaScript page. Ridiculous. ridiculous. Literally, literally 14 times less performant and more RAM than my AI service that you can scale, that you can run, you can observe, you can do security with, etc. We live in an amazing time, my friends. There's never been a better time to be a Java and Spring developer. The technologies that we

can that we have available to us are incredible. You can do anything today. And now I have two terrible dogs. Thank you so much everybody. Have a great day. Thank you. Amazing Josh. Very good talk. I am a dog owner. I liked about the presentation. But are there any questions in the room to Josh? >> Oh yeah. I have a question. Who learned something new? Who had

fun? >> All right. Good stuff. Thank you very much. >> Thank you very much everyone. Thank you Josh. Cheers. Bam.