 All right, so today we're talking about Quarkus and we're going to do it in two pieces. So one is if you've been to Vox Singapore, this is the same presentation, but it's really an introduction on my side. And the second part is Antonio actually going concrete in Quarkus and writing applications. So that's really the 200 remembering the why, the what, the how. And then, and then going for the, you know, the concrete aspect with Antonio. And please, that's why I ask you to ask the questions in the chat so we can, you know, you can get the most out of that presentation. So Quarkus is open source and it's a stack to write Java applications. And the point is you can write your, you know, your good old style monolith with it. That will work. But the project really focuses on three things. The first one is cloud native. And by cloud native, of course, I meant, you know, deploying it in the cloud. But also, I mean, having an orchestration platform that actually handled the deployments and the liveness of your application for you, right. And to really embrace those platforms, you probably have to adapt to some architectural style, especially the 12 factor application model. And if you embrace that one, then you got the deployment flexibility, reactivity and scalability of those apps. And Quarkus really tried to help you in that area. The second one is microservice. You have different app density in a microservice compared to a monolith, of course, but also the communication patterns are different and the scalability models are different. And finally, the serverless aspect is really about startup time. So it's kind of a microservice that has to start really fast. And so that's what Quarkus is really focusing on. So let me do a super quick demo because Antonio is going to do a real concrete one, you know, more live, but let's start with that. So you see Quarkus.io here, where you can read lots of good stuff around the guides and whatnot, but here we're going to just going to start code. So I don't know your actual domain, but let's say Singapore jug and then I'm not going to write a to do app, but I pretend I'll start writing a to do app. And the to do app is it's a backend, it's a REST endpoint. So I use REST easy, JAX REST in this case. It's using JSON, so I'll store stuff with JSON. I could use validator to validate my data. I might want to expose stuff in an open API model. So you see here, I've got a lot of interesting technologies already just for the web, right? Mutiny will have a quick talk about it a bit later. A lot around REST easy, some around, you know, GraphQL, plain server, if you really want to, WebSockets and so on, GRPC. Around data, we have the, you know, the classic Java universe with Hibernate ORM or Hibernate ORM with Spanish. Again, I probably want to have time to show you too much of that, but let's say I want to store that. I know PostResql database with Hibernate ORM. So you got JDBC driver. You've got cloud, you know, connectors of sort around data, whether it be Amazon, Google, you know, here in this case, Elasticsearch, Flyway, Hazelcast, Infinispan and so on and so on. So lots of integration technology. The reactive drivers, I'll mention reactive a bit later as well. Important messaging, like this event-driven approach is super important, whether it be Kafka, MQP, MQTT, GMS, you know, you name it, Kafka Streams and so on. Reactive, you know, if you want a pure reactive model, the way you write applications, we got it covered. You deploy stuff in the cloud, Kubernetes, OpenShift, Lambda, have health care for tolerance. All of that is growing exponentially in the Quarkus ecosystem. So I'm going to show you a little bit of a little bit of a funky, which is a bit of a framework, a function framework, a Quarkus function framework that is abstracted yourself from, say Google or Amazon, Lambda and whatnot. And so on and so on, security, observability, integration. So I won't go into two more details, but go for it. Go to code.quarkus.io and you'll see all of the integration points that we have. So here I've downloaded a simple app, copying where I'll actually do the code. And if you see there, I've got my to-do app here. And the first thing, it's a normal Java app. So the first thing I'll want to do is probably open my IDE. And the second one is to put Quarkus in dev mode, because one of the cool stuff about Quarkus is that it has a dev mode, which is a mode where you're supposed to code. So that's kind of useful. We'll see what that means in practice. So you see Quarkus starting with the debugger, the non-blocking debugger. And it will start the app and is ready to go. So here you see the actual code. It's a normal app, Java application. For people coming from the spring side, it's equivalent to a controller. So it's just you say, hey, I want to answer to hello dash rest easy. And I just want to say hello rest easy. So let me go back here. I do a localhost 8080. I got a landing page that tells me a few things about Quarkus. And if I want to do hello rest easy, which was testing my aspect here, you see it. And I know I'm ready to cut. So it's a low Singapore fresh. And I see the results right away. I didn't stop and restart the app. So here it's let's say a low Singapore jug I refresh. And here I got a compilation error. So the minute I do an error, whether it's compilation or an application error or something that is not showing what I want, I got the results right away and I see my problem. So here I see a maybe you need to learn a bit of Java to remember that the syntax. I go on a refresh and I see the results. It works with database changes, your whole application. Essentially you go refresh and what happens is Quarkus is stopping and restarting itself in this case 0.5 seconds, 0.4 seconds. And it feels like instant to the human high or the human feeling that is. Yeah, the other stuff I want to show you in the native image compilation which I'll explain in a later in the presentation. But it's as complex as, you know, when you when you in in in Maven, at least when you want to package your application, you do Maven package. But here I want to Maven package it in a native mode. So I'll just do that and it takes it. Oh, it will focus my tests expect this. That's another thing I want to show you the way you test Quarkus. You start entirely Quarkus with just the at Quarkus test which will wrap the Quarkus bootstrap. And here you just write your test. In this case we use what's this library again rest assured of course. Yeah, so it was blanking. Okay, so that should work better. So the test failed because I didn't have the right name. Make sure it's restart because then the actual compilation takes a bit of time. Good. And we're not getting good. What's going on? Oh, you guys should tell me I'm just running stupid stupid stuff. Singapore jug. Okay, should be better now. All right, so we see the app starting and here the compilation. This long line is actually the compilation with the Grail VM native image. We'll discuss that in a little one. So let's go back to the presentation now. So why did we do Quarkus? So what we saw is people moving from Monolith to microservices and sometimes from microservices to actual functions. To be honest, we feel that there is a continuum from a code's point of view. So what's inside the box is actually the same code. What's outside is what is different, right? So first of all, the communication model inside the Monolith, you're just talking to the same process, you know, so it's easy. If you go for a microservice, you're talking to a different microservice which might be there or might not be there, right? So you need to adjust that, probably have an event-driven communication model or something like that, right? The scalability is very different as well. Just as a random third experiment, what I'm seeing is that a Monolith is split into 20 microservices. It might be right, might be wrong, I don't know, but that's a possible ratio. But the way you scale a Monolith is probably by scaling up. The way you scale a microservice is by deploying a new instance of that microservice because it really helps on the orchestration pattern. So the orchestration platform will listen to the load and say, hey, it's getting pretty busy. Let me add a new instance to the pool so it scales up. So what's interesting is not so much the request per second for a given process, but the request per second per megabyte because the way you scale is adding new processes, several more processes. The other important aspect is your team of 20 working on a Monolith and you're doing a migration to microservices and you're going to be a team of 20 doing 20 microservices. So the time you have per microservice to code, improve, wait for the test to run, get the feedback loop that I was mentioning like changing something, getting the result right away is really, really important. That's my personal perspective. Why are we going for microservices if it's so painful, right? So first of all, I think it's been enabled by the fact that we have those orchestration platforms that are making the complexity of deploying an app and putting it in production and keeping it up in production. That was hard. So you were just having a big bucket to put everything in production. No, it's just the cost of one extra lemon is pretty small. So you can just deploy many things and it's not going to cost you more necessarily from a complexity point of view. So now that we can deploy many things, we have the option to cut stuff in a smaller pieces and you want to cut stuff in smaller pieces to be agile so that for example, if there is a big chance to happen in app number three, maybe changing the database from a relational database to a NoSQL database, you can change that without affecting the rest and it costs you a small amount of energy instead of having to rewrite your app entirely. So that's the reason. You got much more technical flexibility as well as, I guess, business flexibility, right? So let's go back to Java. So Java at the end of the 90s, right? The goal was to make the fastest, more throughput worthy system on the planet, right? So the best requests per second are possible on one process on a big machine that was answering like web, you know, web requests. That was the big thing at the time. So they took some optimization approach which has some drawbacks. You know, there's always pros and cons to a given choice. So they decided it's okay to start a bit slow if in the end we can be really optimized down the road. So they interpreted Java as an interpreted language when you start and then the key part that are really useful are compiled natively dynamically based on the workload that you're pushing on the JVM and then it's the fastest, right? But the startup time because it's interpreted takes a bit of time. You need to load the bytecode, interpret the bytecode, figure out which bytecode to compile and so on before it's fast. It's the same problem for memory. Because it's interpreted and because you want to do compilation, you will do the compilation in memory, first of all, and you need to keep a lot of metadata information in memory like, hey, that class is used very often and that loop in that class is actually used extremely often. So let's do the super optimization in there, right? So that metadata takes space. So when you say my app is using 20 megs of heap, heap is only a small part of your application. There is also the meta space that the JVM is using. It's some sort of the metadata for the JVM. And the size in memory is the resident set size which is the number for information that Kubernetes will decide we look at to decide whether you're doing an out-of-memory usage and will kill you or not, right? So if you're going above your requests but your limit, your memory limit, then that's what it's looked at. So RSS is really important. And in monolith, the heap is probably dominating but in quite a few microservices, the heap is actually relatively small which means the meta space is comparatively pretty big. So go back to our container platform and remember we got 20 of those elements and then we scale by deploying a new instance of those ones, right? When you compare Java to some other platform, you see that Java having this meta space size could be at a disadvantage and that's why some teams are moving away. Another reason some teams are moving away from it for people that had pretty advanced Kubernetes experience and running Java on it if you had a node crash because the load was pretty high and you need to restart a node or rebalance the load of that, you know that Java is pretty slow to start and there's a compounding effect that makes the system pretty unstable unless you over provision your Kubernetes cluster to compensate for that. So Java was not so great in that environment and that's why we did Quarkus. So what is Quarkus? So it's first of all focusing on the developer. We want the developer to be as happy as possible, as easy, be able to easily do its work as fast as possible and do something else, right? Maybe it's another task. Maybe it's going out or whatever, having fun. So we add quite a few things. So first of all is the live reload that I just barely demoed in the presentation that is essentially a zero config. You just put Quarkus Dev and then every time you do a change and refresh your border then the app is restarted really fast and then you see the results right away. It changes the way you write applications. Quarkus itself doesn't have APIs. It really reduces APIs that you're very familiar with. Some of them are from standards like JPA or CDI or JaxRS. Some of them are non-standard and de facto standard, let's say Camel. Configuration is unified. So there is an extension system that actually can talk to one another. So if you define the database connection in your configuration then that configuration can be reused by Hibernate, Flyway, any system that needs to go and talk to that relational database. So that makes for the configuration simplified quite a bit. Also we try to simplify the common usage. I won't be able to demonstrate that but Hibernate or I'm with Spanish is about that simplifying the crowd operations and really let you focus on the more complex case. And the native image executable generation if we go back to our compilation here so in two and a half minutes what I have is no longer a Java app that I need a JVM to run with but a Java app that is actually a native executable of my platform. So if I go to target to do app snapshot runner the red one here it starts and it is started. It started in 0.23 no, sorry 0.023 seconds, right? And it's Java, let's do it again. This one is a bit slow. This one is fast. And it's the same application. So if I go back there and refresh hold on zoomies I know the hell out of me here. There you go. It's the same application. It's still running. So that's what Quarkus provides you like really the choice of going for this native image compilation or the normal JVM compilation. Right benefit number two. The memory usage is much smaller. So on the same JVM for a very simple application Quarkus will essentially consume half the memory and I'll explain why and if you go for the native image compilation it's about 10% right can go up to 10% of it and it's really important in the density aspect I was talking about. Remember we scale out by adding new instances and we have 20 microservices. So the density of application within a node of Kubernetes or whatever your cloud provider system is is going to be super important. It's the same for a more realistic application. It's the same sort of benefits. So Quarkus is really here at the clone native age. It's the same for startup time. Actually, this is the time to first respond. So we start we do a request get the result and we stop the clock and you see the big difference between a classic classic stack that you might be using today in your in your environment and Quarkus and if you go for the native image compilation it's actually extremely fast. I'll explain that a bit later. Quarkus is reactive at the core and then we expose an imperative model but we also expose a very similar API in the reactive fashion. So we also expose a library called mutiny which has the notion of union multi as types, which is essentially trying to simplify reactive deployment for the masses. Why try to make it easier to navigate that API and back to the API that I was mentioning. So you can use rest easy in a blocking fashion and hibernate in a blocking fashion with JDBC drivers. But now you can use rest easy reactive which is the non blocking version of rest easy with the same annotations and hibernate reactive with the same annotations but a reactive API and you can have a non blocking all the way down with non blocking drivers and finally again we reuse the frameworks you're very familiar with you know Kafka, Camel, Micro Profile, CDI, etc etc hibernate and so on. So how does Quarkus work? So this is how a normal framework would work at build time. Well at build time you do your Maven compilation right and get the jar and then at start of time it will read your configuration file do some analysis here read your annotations like the at auto wired at entity you know at inject stuff like that then build the its internal meta model and finally the framework is ready to answer your request whether it's a threat you know opening a thread opening a pool being ready to answer. Quarkus does it differently we read your configuration read the metadata annotations build the internal meta model of the framework all of that at build time and then we package that in the jar and finally when you start Quarkus well you've already have done quite a lot of work right so the start is faster. So you got less to do every every time you start so you see the start of benefit comes from some of it comes from here. The other benefit is all of the bootstrap classes that were required to be loaded and do all of that analysis that you see in the blue line they're no longer needed because you've done that job already. So the the JVM actually saves that load doesn't have to load that in the meta space and that's how you get less memory to being consumed by Quarkus application so less time to start less memory used and then since you know everything at build time you can remove reflection if it makes sense it doesn't necessarily always make sense like makes any big benefit but sometimes it does dynamic proxies and whatnot. So so Quarkus essentially start other frameworks at build time and then let them use and then you get you have two options you go for a normal JVM like adopt open JDK JVM Oracle JVM right at JVM Azure JVM what do you want or you go for the native image compilation and the native image compilation is using GraalVM I know you will have a deeper presentation a bit later next year I suppose but very briefly what GraalVM does is taking your the VM your JDK classes your frameworks your Java classes and compile everything into an executable right so if you're on Windows that would be a .exe file but if it was to compile everything into one executable imagine the size of the JDK it would be a big massive executable file so what they do is they do what is called the closed world assumption which means trying to detect the code path and eliminated eliminate everything that is not used by the application in a static fashion so they look are they using a WT no let's remove it are they using that part of a hypernet no let's remove that code so the compilation actually end up having being a pretty small native executable and you no longer need the just in time compiler and the metadata information that I was describing before so you also save in memory and you save in startup time because everything is already compiled so there is no interpretation phase there is some dark side especially you cannot do arbitrary reflection I won't go into the detail here probably your gradient presentation will give you much more information but that means the classical Java universe and model has to be adapted because if you have to manually list all of the classes where you any of your framework is doing reflection you're in trouble and that's what Quarkus is providing not only faster startup time and memory usage if you use the JVM but if you go for GrailVM we also pilot essentially GrailVM and provided the right metadata information so you don't have to configure some of the a lot of those annoying GrailVM you know low level details we do that for you we minimize the dependency so it's an opt-in model where you select your dependencies and we try to reduce that scope and we help the dead code elimination so we did some change in quite a few frameworks to optimize that and more importantly all of the Java ecosystem runs in GrailVM so it's not a hit or miss everything works right everything that we covered as an extension works or it's a bug so when do you use the normal JVM or GrailVM so first of all with Quarkus you will get a higher memory density probably better request per second per megabyte than anything out there if you're really after the CPU that is really important then still the JIT will be better than the GrailVM native image same for the garbage collectors okay so if you have a pretty high data intensive application then the JVM is probably making sense and then everything will work and any library that you have will work if you go for the native compilation then you got an even higher request per second per megabyte and a very small startup time in the tens of milliseconds right so it's really useful for serverless applications or system that really needs to start really or restart really fast so again Quarkus is a framework to start other frameworks at build time so Quarkus itself doesn't really have a lot of APIs so the APIs you see are the Jaxerus API the Hibernate API the Spring API the I don't know Vertex API if you want to and so on there is a ton more about Quarkus I hope you did put quite a few questions in the in the chat and I'll be able to answer what I wanted to mention is there is a spring compatibility layer that looks at the spring annotations and convert them at build time to the equivalent Quarkus annotations so it's not really for taking a spring app and make it run in Quarkus but it's for taking somebody with Spring knowledge and helping him towards or her towards Quarkus without having to not only transfer the technology but also transfer people starting with that but very quickly go for the native you know Quarkus driven annotations whether it be Jaxerise or CDI and so on because they are very similar so it's really easy to move from one to the other if so I'll leave you with those four benefits for Quarkus we focus on the developer to make him or her really efficient and happy have a super short feedback loop helping deployed into the cloud whether it be communities open shift good and Amazon Lambda whatever it's super low in memory usage super fast in startup time the core is reactive but then we let's give you the choice you can go for the imperative model or the reactive model and we try to provide a very similar set of APIs so you're very familiar with both models and finally we expose libraries and standards you use and love so you don't have to it's a revolution in one aspect it's just an evolution in another aspect so we don't try to say it's an entirely new programming language you or programming API you have to learn and I'll stop there and I'll give back my screen to um to Antonio well I think you've been crystal clear because we don't have any questions so oh common people common people can you see my screen guys and there is there is actually one so if you get provided with an open API file how to digest that in Quarkus to create routes very good question I do not exactly know the answer from I know it's possible I think Apicurio has some Quarkus generators so you can take an up write an open API file with Apicurio and generate it with Quarkus so Stefan if you send me an email to E Bernard at I'll get to more one I'm more of I'm writing the app and generate the open API model myself but you can do it the other way around so just shoot me an email I'll follow up with you thank you Emmanuel thank you Stefan I think Antonio the floor is yours okay so everybody can see my screen alright so the idea is I'm going to be doing a few copy paste because I want to be quick and I want to actually and do some fullbacks et cetera et cetera so I'm starting with an empty project the only thing I have is I have a Kafka running here so I have a docker compose so if I go docker container LS I have Kafka and and Zookeeper but that's it I have nothing okay so I'm going to write three microservices if you have read my books it's about an API of creating books so it's the same kind of topic so I'm going to create a short microservice that creates books but for creating books he needs I be ISBN numbers so that's going to be a neither another microservice and because I'm going to use HTTP they rely on each other so when the number falls I'm going to add some fall fall back so it sends a message to a Kafka queue and later the book will be created so I'm going to try to be quick but hopefully you know not too quick so you can understand Emmanuel has used web page you know code dot quarkus code IO to generate to bootstrap an application but you can also use the Maven plugin so here I'm using the quarkus Maven plugin which does the same thing I'm using the brand new shiny quarkus 1.10 3 and here I'm just saying look create me a class that I'm going to call book resource so that's going to be the microservice to create books with this this path so it's going to be on slash API slash books and I use rest easy and and json B because it's going to reduce some json so that's the extensions that Emmanuel showed you okay so if I do that the Maven plugin creates a book directory and inside this book you have exactly the same code that Emmanuel showed okay so because it's several microservices you know what I'm going to do right now it's change the port number this way it will be listening 8702 so if I do like Emmanuel did Quarkus Dev so on the upper oh sorry on the upper left I'm going to leave the the book microservice running okay so unfortunately I think there's a bug somewhere later on and and I'm going to restart it which is unfortunate but you know otherwise I'm not going to touch much on the on that so if I curl this API I've got alo rest easy like Emmanuel showed you okay good but what I want to do is not send alo but it's create Quarkus book Quarkus book so that's going to pass I'm going to pass a title okay and it's going to return a book so actually this API will consume text so I'll I'll I'll just pass a title of the book and so it's going to consume text but it will return and jason so here I'm saying jason okay so now I'm going to have to create a book class so let's see credit here oops sorry so the book class it's going to have a title okay a topic the ISBN number the famous ISBN number and so we can have a bit of instant created on and I'm going to do instant now so we know when the book has been created so now what we're going to do is when we receive the title we create a new book okay and so book dot title is the title that we've just passed then comes the topic well there's only one topic so let's go Qoakus then there's the ISBN so these were maniacs right this is where I'll invoke the microservice later and that's it so I return the book so now I have to do an HTTP post instead of a get so that's like that so okay I'm I'm just invoking slash API on a post passing so the minus D is the data is the title so understanding Qoakus so if I do that you can see here no you can't see anything so let's do that let's do book created so we see some logs otherwise so if I do that up well what's happening all right so if I create a book oh what's happening method not allowed what am I doing wrong so I'm consuming text I'm producing json so why do I have a four five no because it's a post sorry yeah and because you know let's make it nicer so I generated two string oops here I'm generating a two string method this way it's much nicer and you know as Emmanuel said the good thing is I don't have to restart Qoakus again and again I can do that with a curl command but I can also go and check the swagger UI so swagger UI comes when you add an extension so this famous extension I've started with just rest easy so now I'm I'm using you know again the maven plugin and I'm saying please add an extension call you know open API and I just do that you're going to see oh sorry I'm not in the right place so what what does it mean you know it has restarted not much you know I could have done it by hand but on the POM XML now I have open API thing Qoakus I say understanding by the way so we're in dev mode so that's why swagger UI is enabled by default but in production by default swagger UI would be disabled though you can force that with a Qoakus dot something property and let's also fix the test because it's going to be useful so now if I do maven test it's going to crash because it's you know it expects rest easy and I don't have a get anymore so here I said should should create a book and so this time it's so I have to give it a body the body is the title of the book title of the book so when this time is when I do a post okay then it's a 200 you know it's fine it should have been a 201 but it's fine and I'm going to make sure the body is correct so the body is I make sure the the title is title of the book the topic remember that we've set it you know it's it's caucus and it has an ISBN and created that so here I'm I'm using rest assured to check the jizz and result so hopefully I I haven't made any typo and the test pass no God jam created on okay sorry created on and I'm testing because then you're going to see that it's going to be quite a useful okay good now let's do what we are supposed to do now which is invoke another microservice so for that I'm going to use again the same plug-in the same even plug-in and create a second microservice this time it's going to be called number here it is same code so if you look at you know it's a rest and point it returns hello rest easy so here this method is going to j no rate an ISBN number yeah it will return a string and so a number and an ISBN is 13 number digits so let's put it 13 and let's go new random next int and you know something like like that so we just you know a random number and we're going to do oops number no ISBN and we're going to return this number again I'm going to leave it leave Quarkus in dev mode later we will kill it but now for now it's fine and so if I curl this oh yes you know what I haven't done that's why I need to shut down Quarkus because I'm going to change the listening port so let's do it so number will listen on 8701 book 8702 so now I'll start Quarkus in the right port number and if I curl it I should get a number okay well now you know what's going to happen I'm going to link both microservices and for that there is a really nice extension coming from the micro profile which is rest client so if I do my post again you see that I create a book with no ISBN so let's fix that so first of all I need to add a new extension it's called rest client it comes from the micro profile so again it's just a matter of adding an extension Quarkus restarts easy peasy and now I'm going to actually cheat so I'm going to take the number resource I'm going to do a copy paste on book here I'm going to call it number proxy so you know naming things is odd so leave let's leave it simple so the the rest client the micro profile rest client says well just create an interface with the same signature so I leave everything but the body I can even take that out and the only thing I need to do is register that as a rest client that's all okay so now the book resource what I have to do is actually inject my number proxy let's call it proxy and here I go proxy generate number do you think it will work yes no no why because there's only one piece of information missing here I need to say that I just want to copy paste so it's not too long here I just need to say you know the remote microservice is on the other side of the planet so I need to give a URL as you can imagine here it's a local host and set into concrete but in real life you know of course it's it's going to be an alias and that's it so it's working it's working and my test is passing why well because you know each time I run my tests there's actually an invocation on the microservices that means that if I kill the number microservice and run my tests it will not work so what about mocking and I have to say quarkus makes life really easy so let's mock the number proxy makes life easy because it's just a matter of of course implementing the proxy therefore you have to implement the generate ISBN so you don't want to invoke the remote service so you just go mock ISBN and the nice thing that quarkus bring is this mock you know one rotation so it comes from the package IO quarkus test mock and you just need to add you know again the rest client thing so now if I run my tests they should succeed great okay so now so let me recap when I do a post with the number of microservice running it works it's fine you know everything is happy sorry you know so that's fine but now of course there's these dependence now on these both microservices meaning if I kill the number it doesn't work what we want to do is we say well we would like to store that somewhere sending to a you know a Kafka queue or somewhere else and later on it will be created and again that's super easy with the micro profile again there's this extension called fault tolerance so I'm adding fault to tolerance to to the book and here so on the create book see the problem is we invoke the microservice and the microservice is down so we need to fall back on something different well what we can do is you know again copy paste this this method and say well this is actually falling back on creating a caucus book the problem is here so sorry no ISBN microservice is down will create later and here I go fall back will book will be created so now we're going to use these full back connotation coming from coming from full tolerance I think let me refresh full back I think it's my ID not Oh sinking yes it was just my ID who so here I said fall fall back on a method called fall back on created so the only thing is fall back if there's a new vacation failure it will fall back on a method that has exactly the same signature so it has to take a string and return a book okay so now if I curl again I think that's when I need to restart caucus and I don't know why I think it because there was an exception and I don't know but I have to so you see it's falling back if I start the microservice the number microservice as you can guess it will create a book with an ISBN number but if the ISBN number microservice is down then it will fall back to something different well like we still have a few minutes so let's fall back on a Kafka topic you know it's Kafka it's fashionable so let's do that so caucus comes with another you know extension the reactive messaging Kafka so I'm adding this extension to book because what I'm going to do is inject inject a channel so the channel comes from oops the channel comes from this extension I don't know why my ID doesn't refresh yes import class and here I I give the name of a channel so let's say failed books so the name of this channel is quite important what do I inject well I inject an emitter and I'm going to emit let's say for now a string so the string representation of the book okay so now that I have this emitter when I fall back what I do is I send the book to string it could have been an object JSON representation I just wanted to make easy and now sorry again for the copy paste but it's a bit long what I do here is I said well the the full books failed books the connector is Kafka because it could have been MQTT MQTT impq or whatever and she realized that into a string because I could have put JSON I could have put binary okay so what's really important here is this fail book it has to be the name of of the channel so if I fell back I'm going to send the book to a Kafka channel well guess what we're going to create a third microservice that's going to just listen so here this time I will use different extensions sorry yeah I'm going to well let me show you on the pomex ML it will be easier so this book fall back the book fall back uses the messaging Kafka only okay it's not a REST API or whatever so actually because it's not a REST API I'm going to go here and delete everything this method let's call it the way we're working on a generator that would actually generate extension our piece of code instead of just having the REST endpoint so it's coming real soon so here I will receive a book in a string of representation it returns nothing but you can imagine that this method could have been slightly clever and I'm going to do a book to be created later and now that's really nice we have this sanitation coming from the micro profile messaging and we just give the name of the channel that's it well that's not completely it because as you can imagine there's on this side of the microservice there's also a bit of configuration so we go the fail book this time is incoming the other microservice is an outcome the fail book so it's the same name of the channel and I'm saying listen to Kafka and please deserialize with a string deserialize and my Kafka is up and running so if I if I start oops Quarkus in dev mode on the on this microservice and I try to create a book oh yeah that's not falling back I think that's again I need to restart when I do that so it connects to Kafka I've been having so and shake fell oh why I do have my Kafka running don't I yes so what happens if I curl that so yeah it's it's sending but it's not receiving so I might have done something wrong which is unfortunate so here I have failed books oh typo damn and I think I have to restart it yeah so it's failed books with an s are damn yep you should open an issue yeah yeah each time I use Kafka and I do that like here it won't take see book created later so I have to kill it and restart it and it's always when I use this messaging thing that I have that so yes so please open the issue with yeah good so as you have imagine if I now have the three microservices running so if I can get an ISBN number it's fine you know I can create a book with an ISBN but if the microservice is down then it falls back it sends it to a Kafka stream and topic and and the job will be done later actually I still have a few minutes so I've created this loop which is exactly what I'm doing it's a curl okay it's it's a curl any clips so it creates a book you know every second so let's leave it here what I wanted to show is let's take the number yeah if it's going to be easier so if I do a clean package let's keep the tests so we were running in dev mode as Emmanuel said if you package it you have like you know good old spring you have a job an executable job so you can go Java job it starts very very quickly as you've seen but also I can do the the native compilation so you know Emmanuel uses the dash P native which is the same thing so so well it's going to be oh yeah the tests so Maven tests keep you know it's supposed to be a reasons like don't waste the three minutes for compilation if the test don't pass but for them yeah yeah it's easy so it's going to take a bit of time a few seconds because I have a huge machine but it is indeed a bit slow but what's going to happen now it's thanks to growl VM we're going to have an executable so very very tiny of course the micro service there's not a lot of code you know inside but as Emmanuel said the compilation the native compilation takes also your bits and pieces of the JVM or the substrat VM so in this binary you have everything you don't need an external JVM so and then yeah I'm going to do that then by the way I can express enough what I said it's like I've had conversation with so many of our clients which had issues where you know their Kubernetes cluster also open-shift in our case where really bring doubt through their knees because of the slow start-up and initial high CP usage of a Java app starting so you know this is exactly why Quarkus is starting fast and so on it's helping in those situations and avoid people having to overcome it there we're not overcoming but set a cluster that is twice as strong as it should be really just for the start-up right so we're really wanting to address that problem so here if you look at the binary it's 28 megs and in this 28 megs we have the JVM bits you know the only bits that we need so you don't have to go Java-jar and you know it starts really quickly and that was you know what I was saying is it responds quite quickly. There is another trick I want to do is I'm going to build a native but for a native container so that's another you know minus the Quarkus property or Bama the test. Why? Because now I've built a binary for macOS but if I want to deploy it on a Docker image I want a binary that was built for Linux and on my Mac you know I can't or if you are on Windows so it's quite clever the way you know Quarkus does it it's it goes and you need Docker it takes Docker image with a Linux box in it and it just compiles using it so now I'm compiling for Linux without having a Linux so again and you know Docker or Podman for like some people use Podman for that so and so unfortunately it's still a bit you know long but and then yeah that's what I'm going to do. So now I'm going to have a binary that doesn't run on my machine because it was compiled for for Linux so we went from 25 years of you know develop anywhere and you know run everywhere. Compile once run everywhere. Yeah that's the end of it. Compile to one compile to one it's a new model right. So it said is Mark as an executable but could not run by your operating system. Good you know what Quarkus comes with another you know extension the Docker or you can also use Jeep so I'm adding this extension and now what I can do actually is now that I have a binary created for Linux I can package it in the container image so when I use this minus the Quarkus container image build true what it's going to do it's you know when the project is created there's actually a few Docker files. Oh what it was the the test again. Oh damn. Keep calls true. Yeah and now it's creating yeah you know everything was there so if I do Docker image LS the image is here and now is just a matter of you know running and here we go. So when you create a Quarkus app it also comes with a few Docker files to make it easy and there's even later you can add a Kubernetes extension for Minikube and I could have done that with Minikube. So here it is for me you know I've developed three microservices with Kafka with you know Docker and everything quite you know easily and without starting too many times Quarkus that's it for me people. Cool so if people have one you know last set of questions just go for it I try to answer quite a few in the chat so thanks for asking it's always good plus I didn't know the answer but luckily I could connect to some of my colleagues and get you the proper answer. Stop sharing that's what I want to do sorry. So somebody was asking for example what are the spring the spring to Quarkus annotation conversion so you can go to Quarkus.io slash guides Quarkus.io slash guides Quarkus.io slash guides and then here there is a conversion with compatibility sorry and here you got the spring DI compatibility spring white compatibility and so on. So in practice if you go to spring DI or spring web you will see the list of annotation and then there is a table that says left left is the spring one right is the either Jax or S1 or you know something equivalent. So you can go there a spring data is a bit different spring data does expose API so it's literally the spring data APIs that we were having you know also at runtime the engine is different but the API is the same so there is no conversion so to speak it's just the engine is executing what you're asking. So yeah go for those lists and if you see another UI bug but if you see a set of extensions that you feel you wish you had from the spring side that are not there then just have a conversation open a github on so you go to activate again Quarkus.io is a community here and then first of all we have our roadmap but here you can go on github sorry the github issue tracker and open an issue you can flag it but otherwise we got a bot that sort of autoflag stuff and you know of second level is you provide a pull request or something but worst case it's listed and the community can react to you know plus ones and the priority of things and figure stuff out we've been extremely reactive we do one release every month approximately since two years or something so not too bad. So I'm adding the github link with the demo that you've seen and there's also a huge readme you know I've been doing copy paste from the readme file so if you go to this link you have all the code of the microservices done how to use them how to start to test them but more important for me and now for you is the readme tells you how to go from scratch to what we've seen so it's exactly what I've done I've detailed all the readme do this and do this and do that so you can go there get all the code or start from scratch the only thing that I had was the infrastructure with the with the Kafka and the bootstraps so the Maven plugin command that will bootstrap the three microservices so you know to grab the code and you know run it even at work with your colleagues you can do that at work or you know at home with your family if you want to board them. So there are two questions so Timothy is asking will there be a continuous integration with the test continuous integration be extended to the native ARM64 given that Apple and Graviton are two I think Graviton two is the Amazon testing of the Apple hardware coming or something maybe I misunderstand but so the CI we're using is actually GitHub actions so when GitHub comes with Apple M1 hardware we'll be able to have that that being said a radar has been contributing to the Graviton ARM64 support we've really accelerated and pushed Oracle that way and so it's there it's available and of course it's been there in the JVM which again has been a radar contribution so the ARM support for the JVM and Graviton is there I don't think we have CI tests specifically for those if I recall but yeah I guess we'll just wait for GitHub to grant our wishes on this one. The second one is is there stomp and sub-js support in Quarkus? The answer is I don't know do you mind asking that to the Quarkus dev mailing list so it's a Google group or opening a Quarkus issue in what I showed like a Quarkus IO slash Quarkus on on GitHub. I appreciate it plus it's about not my pay grade but it's about my knowledge so I don't want to say something stupid here. Okay and correct me if I'm wrong Emmanuel but I see you wrong. Okay I knew that. Now I think there's support for Raspberry isn't it? Well yes through the ARM support yes so some people have been playing with that. Okay I guess let's call it a day and of course people can come to as I said Quarkus dev and ask us more questions I think Antonio you're lurking around anyway in these spaces so feel free to reach to any one of us. Thank you a lot Emmanuel and Antonio for this great live coding and lecture. Give a big round of virtual clap or you can clap if you turn on your mic to everyone and thank you it has been the meet-up with the most question asked for a long long time. Okay cool so it's possible people no that's really good we need to find new ways to interact since we cannot be physical physically together. Physical together is a different thing but physically together one is upside down. So yeah just force yourself to express it in this you know digital native way I guess. And sorry I was busy coding but I just renamed my zoom so as you can see Emmanuel is Parish and I'm Parish Central. Nice. Alright thank you thank you everyone. And thank you guys. Finish with a global king wind from Antonio. Yeah bye. Bye everybody. The recording will be available soon.