 So hello, my name is Martin Štefanko. I work in not Kvarkus team, but I work mostly in Kvarkus. Adrethat, you can find me on these links and please do if you will have any questions about Kvarkus after the talk. Usually I am responding on all of these channels, so please reach out if you will have any questions. I want to point out this at the bottom, there is a code for 35% of any many products because I am writing a book which is called Kvarkus in Action, which you can already find in the Early Access Program, first six chapters, which are published. So hopefully I know a thing or two about Kvarkus, so hopefully you will enjoy this talk. Please, I really don't have any slides. This is the closest to slides, what you will see today. I will open the terminal and I will start typing. So please, if you have any questions to what I'm doing, just shout. If you want to see something, just shout. We are here to make it interactive, to give you the most of it as I can. So, and with that, I will show you this slide at the end, so if you would like to see some things. So hopefully, tell me when this is big enough. Everyone can see even in the back? Perfect. So, okay. So, the idea how to start with Kvarkus, of course you probably know that there is Kvarkus.io, which is a site where you can find all the information related to Kvarkus. Sorry that I don't see you throughout the monitor. You need to deal with it. Basically, if you want to start with Kvarkus, the easiest thing, if you prefer clicking, start that coding or code.kvarkus.io, maybe I should ask, how many spring boot developers or spring developers? Raise your hand. Great. Start that spring.io, code.kvarkus.io. Exactly the same thing. Just here, you can see that in spring boot you have starters in Kvarkus, we call that extensions. You can see that the least, you probably cannot see how big the bar is, but I can click here, show more extensions, and it's even smaller. I can show you it like this. It takes a while to scroll through these, even on the computer there is around, I think, 1,000 extensions, which are supported. Kvarkus itself contains a lot of these extensions directly integrated into the Kvarkus platform, however, because the community demand is bigger than we at Red Hat can maintain in one single GitHub repository. We created so-called Kvarkiverse organization, which you can find on GitHub. GitHub, Kvarki. If I can type it correctly, yeah, Kvarkiverse, which is basically another set of extensions, which is basically done by community. Kvarkus will give you a repository for your extension if you want to maintain your extension with the whole CICD integration into the Kvarkus platform, so with every Kvarkus release you will be tested, you will still be sure that your extension compiles against Kvarkus, however, it lives in your repository, which is under the Kvarkiverse organization and you maintain the code. So, in this sense, if you have very cool library, you can get it integrated into the Kvarkus ecosystem and still maintain the integration yourself. And as you can see, there is also a bunch of these repositories done by community because we just cannot, I don't want to spend any more time compiling Kvarkus if I need to work on my extension because of your stuff, more or like this. But Kvarkus comes also with this command line interface, which is basically just a CLive wrapping everything that you are doing in the command line with Kvarkus. And one of these things is this create application. So, if I want to create, because I don't like to click, create Kvarkus application, I can just type create app.io.xtephunk. Let's call it devconf 2023. Very, sorry about that. So, what this does is basically it will generate a Kvarkus application with very basic stuff out of the box. Out of the box we will get rest support, maven wrapper, maven config, basically some docker files, and this is if you don't specify anything. With that create app, you can also specify any extension that you would like to add on the compilation to the project with minus x, so I can start typing name of the extensions here, but I will not do this. The basic idea is that some of these extensions come with so-called code starts, which is basically some sample code to give you the idea of what you are basically integrating, but typically this is very good for people that don't know what they are doing. Let's open this in idea, but if you know what you are doing, then typically it's just the stuff that you need to delete. So, because out of the box it edit, rest easy, reactive extension, where is this so slow? It, yeah, sorry about that. Give me a second, I need to remember the shortcut. I'm working on it. I just need to give me a time to remember the shortcut. So, with these, we will get JAXRS resource generated with some sample string. It's just some sample code to remind you of the API that you are integrated. What that Quarkus extension is, is actually only a maven dependency from IoQuarkus in this one, IoQuarkus group ID and Quarkus dash name of the extension. Quarkus extension is basically integration layer of any library that you are putting into the Quarkus. Why would you want to use Quarkus extension and not directly the library? Because first thing, Quarkus is built around a few concepts which we don't have time to dive into in 30 minutes, so please catch me after the session if you are interested in this. Which you have access to inside the extension API. For instance, built time, sledge runtime processing of application code, compilation to native, so adding some custom flex to Gravium, et cetera. So, this is why, if there is a Quarkus extension, please use that. Otherwise, in JVM mode, if you are running Quarkus on JVM, you can use anything that you like from Java ecosystem. In JVM is still same old, but brand-shining new Java application. If you want to compile to native, which is a separate use case with Gravium, then you probably want to stick to extensions because that extensions will give you that guarantee that you will only type somewhere down here minus d or minus p native, and it will compile to Gravium native. Because that Quarkus extension is actually responsible to make this happen all the time. So, if you have custom library without that integration, it might cause some problems. However, you still have access to some APIs in Quarkus itself to mitigate this, if you need to. Okay. So, first things that always you will do with the Quarkus project, if you will open it, is so-called Quarkus Dev. Just to mention, if you don't want to use this Quarkus CLI, in the background, all this does is call Maven, Quarkus column then, which is Maven plugin, which is directly integrated here. Somewhere, Quarkus Maven plugin. However, if you use this Quarkus tool, the benefit that it gives you is that it will shield you from the actual builds tool that you are using in the background. So, you can also use Gradle, which is not that unpopular as many people think. So, if I need to work sometimes on Maven and sometimes on Gravel, I am prefering to use Quarkus CLI because this will always run the correct invocation of command in the background. So, what is Quarkus Dev, or Quarkus is Dev mode? So, basically, this is singlehandedly the most productive feature that I got when I started with Quarkus development. What it does is basically, it runs continuously application in the continuous process and it dynamically recompiles any changes that you are making to your application. And if I am telling you any changes, big enough, let's just verify that I can call my application that generated hello endpoint that I got there. So, now it's my application responding from the greeting resource hello from RestEasyReactive. And we are on DevCon. Oh, ahoy, RestEasyReactive. I will just save the file if I repeat the same call that class was dynamically recompiled in the background. It was exchanged with some call holders, et cetera, but in the general, you have a new version of your application in a few milliseconds, like in 800 milliseconds. So, you can imagine that the workflow that you are doing is typically these terminals are on one monitor, ID is on another one, and I am just continuously typing the code, just refreshing the page on one terminal, and my application is running for the whole day. Typically, really, if you are not doing something crazy, which, again, I am working on Quarkus, so I need to do crazy, so I need to restart it a few times, but if you are writing your application, you don't need to stop this for the whole day. And basically, this is the first really nice feature. So, let to go from here. Really, in 30 minutes, I don't have that much time to show you. So, here in the bottom, you see that you can press a few buttons inside this terminal and something happens. So, h will give me all the options that I can do inside this dev mode terminal. Now, probably second best feature that you will get in Quarkus is continuous testing. Since we are already recompiling your application, why we cannot run all the tests directly with it? So, if I type R now inside my application, Quarkus will start continuous testing and then it will start running my test in a background and, of course, it failed because I changed something which that test is trying to asset. It is expecting help from REST easy and I now have always REST easy. So, if I go into the test itself, and actually let me do it like this, I will move this terminal into the same workspace, so you will see some magic. So, inside that test, I will fix the test. And I will just save the file and you will see that dev mode automatically recognizes that I saved the test and it will rerun it and we see that now my test is passing. Nice. For me, this was impressive when I saw this first time. So, you get the idea that you are basically just typing your stuff and you have this continuous testing enabled and by just saving the file, all your tests are automatically rerun in the background. So, if I don't see on the periphery that something red is jumping inside the terminal, I'm not even looking at it. I'm just typing continuously. One heck that I learned myself is actually because if you are familiar with spring, spring boot test, annotation, these will still run a new instance of Quarkus. Quarkus test will run a new instance of Quarkus against your test. But, with the dev mode, this is still a runable application which you can call normally. So, if I'm not doing something which is really changing something inside the application which would interfere with what I'm doing inside my application in the dev mode, I will just comment out this Quarkus test application and I'm pinging really the application in the dev mode because you see that this took 300 milliseconds if I need to rerun the test. But, I think that we are, I can rerun it and now you see that it only takes 18 milliseconds because this is just HTTP invocation against the dev mode. So, in a few milliseconds, I can run hundreds of tests against the dev mode if I'm just testing something which is not changing something or if it's changing it in a way that I can still continue what I'm working on. But, of course, then you will just uncomment the annotation and it will start the new instance against which you are testing. Okay, it takes 300 milliseconds which can bump up depending on the test, but you get the idea. So, I put it back here and press H again and what is now happening? Yeah, better, sorry. So, what else you can do? With that continuous testings because definitely there will come a question like I have a bunch of tests and this takes time. You can play with these, you can only set to run the fail test, you can, I don't know. Oh, okay. Quarkus will try to do its best to guess what kind of code you are changing and it will try to not rerun all the tests all the time. It will try to rerun only the set of tests which are relevant to the code which you are changing, actually, on that iteration of dev mode. But, of course, this is still software, so it's a guess, but typically it works pretty good or you can just toggle the broken only mode which will only rerun test that fail. So, go ahead. We'll get there, but yeah. So, the question is if this is only running unit test or it can get run integration test too. Actually, this is integration test because with that Quarkus test annotation we are running a new instance. So, yes, this will also run dev services and we will get to it. So, this will run everything in the background continuously. Okay, I don't want to jump, so we will get to the services, definitely. Another cool feature that you can play with here is this dev UI which by pressing D inside this terminal, you see that maybe you don't, but in the bottom my browser opened and the new tab, which is basically, oops, I didn't want to click. I want to put it down. It's basically development clickable interface inside your dev mode where each extension can add whatever they want. So, Arc, for instance, which is our CDI container which is responsible for dependency injection, you can just click to list all the beans inside your application like migrating resource, for instance. Or you can see these very nice removed beans or removed components because, as I mentioned, Quarkus is doing a lot of stuff at build time. Of course, in dev mode, build time and runtime is the same thing because we are already building the application at the same time, but if I would make a clean package, so I would actually compile my application, Quarkus would remove 65 CDI beans which are never going to be used inside final produced jar, in final produced application. So, this is like 65% less, 65 plus is less memory and less processing at runtime, just to give you the idea. Okay, extensions itself. We will get to it. Okay, so, I am here in the right side terminal, I am in the same directory. So, here I can run again that Quarkus which is short for extension, which will print all the extensions that I have currently installed in my application, which is not totally true. Let me restart Quarkus here. So, you don't think that I am telling you something wrong because you can see here that I have that CDI, Small Right Context Propagation Vertex, which are some extensions which are always included inside Quarkus because CDI, for instance, that arc is integral component for Quarkus itself. Quarkus internals are wired through that arc container too. Vertex, for instance, is a reactive set of libraries which is basically the core of Quarkus. Everything in Quarkus is reactive and we will get to it. So, this is why we have only rest easy reactive because this is the only optional one which we edit on top of that when we generated the default application. If you type dash I here, which is installable, it will list you all the possible extensions which you can add to that Quarkus application which is a very long list because we have only one extension. You can play with it, but we don't have time. There are categories. You can search for particular keywords, et cetera, inside the terminal itself, or if you are lost, you can search inside that code that Quarkus.io or what I actually prefer because, sorry, I need to go on Quarkus.io because typically if I don't know what I'm looking for, I need to find the documentation of how to use it. So, for instance, when I was trying to learn Kesh, I can just search in learn documentation which is basically official Quarkus documentation that consists of set of guides which are step-by-step instructions ranging from typically 15 to 30 minutes, but some of them are even 60 minutes on particular extension, how to edit to your project, how you can configure it, how to use it. So, after that 15 minutes, typically, if I go into data Kesh, after these 15 minutes, I have the idea how to edit to my project, how to use it inside my project, somewhere, blah, blah, blah, somewhere, you get the idea. I personally, yeah, here, Kesh result, I personally really like this kind of documentation because in interactive way you will really create an application by in which you can continue experimenting after you are finished with this guide. So, typically for me, if I don't know what I'm looking for, I am going to that Quarkus guides, but you have the idea. So, if I want to add an extension, you have directly a command here or you can just edit to your application, but since we are using the command line, I can use it here. So, I will add, for instance, the one that I am maintaining, which is more I helped, and I want to show you a magic. You see that just by adding an extension, Quarkus also restarted and now I have new extension installed in my application. And actually, this extension comes also with some API slash q slash health. So, now I have exposed a new API. If I remove that, or before I remove it, I will show you both actually that Quarkus extension add is doing. It will basically just add the new Quarkus dash smaller I held dependency into my Pomex ML. But this is enough to restart the dev mode and you have that extension installed. So, again, not stopping the dev mode continuously running, I'm just experimenting any stuff. I can remove it, and hopefully this will just remove it. And after the dev mode starts, now I don't have that endpoint anymore because I removed the extension, which was adding it. The funny part is that, let's take that cache one because I don't remember any extension. I will just copy paste, or maybe I will just copy paste this because I don't have that cache in the latest version I think locally on my computer. So, yes, you see that even I don't have it on my computer and what Quarkus does, it will dynamically downloads it from even and it still works. So, not stopping this really for the duration of what you are doing. Okay, so, let's remove this. Some more fun stuff. One of the very good features of Quarkus, after this, what I was showing to you is framework for Hibernate ORM, for database access, which is actually called Hibernate Panache, which is framework done by Hibernate team, which is not in JPA, but it's something which is the preferred way how to do database access in Quarkus. And with this Panache, you have basically two options, how to implement the entities, active record pattern and repository pattern. So, if you are coming from spring, you can do very similar repositories in Quarkus. But what I want to do is, because I can just add the dependencies directly into my poem and just save that file and Quarkus will still restart in the background. I want to show you that, what I basically added is just that Hibernate ORM and I added a driver for Postgres. Just because, and this feature that I'm going to explain now is called Dev Services, just because Quarkus sees that I added a driver for Postgres, so, I probably want to connect my application to Postgres, but I didn't configure any connection to Postgres. Quarkus goes ahead and starts a new Dev Services container for Postgres for me. And this actually started Postgres container in the background and if I press C here, you will see that it started a new inspiring Gagarin container for me and it automatically injected configuration that automatically connects to the container. So, now my Dev Mode application is actually connected to real Postgres database running in the container, which is tied into the run of the Dev Mode. If I kill now the Dev Mode, it will stop the database in the background. And this feature, Dev Services, it's something, and now you can start typing basically any code, Avenger, Extents, Panache, maybe I need to reward my man. Come on, Pa. Oh, come on, Panache, Entity, this needs to be Entity. This is what I'm typing here is that active record pattern. So, basically we are encapsulating all database operation into the Entity class itself. So, I can just type my properties in a public fields because I cancel string name, public string civil name and public Boolean snapped. And this is everything that I need to do for my Entity. ID is generated because this Panache Entity contains the generation if I don't need to extend it. Of course, if you extend the Panache Entity base, you can customize it, but you don't need to. What is happening? Go back. And because Quarkus is doing a lot of processing at build time, we actually can like not force you, but we can tell you to use public fields because if you have private fields with public getters and setters which are just getting and setting, it's just public field encapsulated. What Quarkus does at compile time because it can also generate bytecode, it will first thing, generate getters and setters for you in this class and of course, default constructor, false hash code, et cetera. So, it's a valid Entity and it will rewrite dynamically any accesses to this public fields in different classes to use that newly generated setters because you can dynamically transform bytecode. If I want to use it inside my Entity, getV, let's do it at path full and this will be a list of, come on, list of avengers. What is happening now, computer? Get all, throw exception. Because everything is now encapsulated inside that entity itself, so select star from avenger entity is just list all. Now you have a bunch of static metogs directly on this resource and you also have, create, we will return avenger, a bunch of, we will take an avenger. If I can type avenger, this is not autocompleted. Of course, we need to still handle transaction, but what I can do is just on the avenger itself, call some methods, which will basically encapsulate entity manager operation. So, if I want to persist something, it's just avenger.persist and I can now return the avenger. We don't need to play with this that much, but you can imagine that, like for instance, that persist operation will actually do the persistence into the database so you will get the ID generated, et cetera. I don't have that much time to show everything. So, if I hopefully, and I need to move this because I want to have this on path slash and we will move hello on path slash hello. So, we will get, let's do avenger. So, if I now call 8080 slash avenger, hopefully I should get list of avengers. Yes, I am getting a list of avengers, which is nothing, but with Panache, all you can actually do inside the dev mode, create the file in certain domain resources called import SQL and I hope that I have avengers import, I have, where you can place any SQL that you want to get executed when the Panache is bootstrapping. So, hopefully if now it starts, yes, I am getting a bunch of avengers, but I don't have the correct extension, and this is the one place that it sometimes break, so wish me luck, and it broke. So, this is the one place that because I am rewriting the extension, which is encapsulating in the background, thanks, the rest easy reactive extension, rest easy reactive, Jackson is just adding Jackson support on top of rest easy reactive, I need to restart the dev mode, but at least I can show you that because I killed dev mode, it also killed my Postgres database, and now a new Postgres database is starting for me because I am restarting the dev mode again, and now I have a new Postgres for the new run of the database. And this time, hopefully, I am getting back avengers in jasper. Okay, so, this is basically the dev services is automatic management of test containers in the background, so basically this works out of the box, and because I don't need to remember this, I can just type here dev services. This works out of the box for a bunch of stuff, of course, we are adding this continuously, so it works for all the databases, like Postgres, MySQL, I don't know what else is supported in the container itself, MongoDB, as you can see here, but it also works for Kiko, for instance, if you are working with, like OEDC, for instance, it will automatically start Kiko for dev mode, for IMQ or Kafka, it will start Red Panda, Broker in the background. So it's very streamlined development, where you don't need to care about the infrastructure that is basically you are depending on, it's automatically managed in the background for you. And these dev services are not only limited to dev mode, but also if you write any test that would need to access the database, actually that Quarkus test will start a new Postgres container just for that test execution. So every time that you are running tests, if I would run continuous testing, where I would be persisting something to a database, it would run another Postgres database, which is just used for the testing. So no more application development against Postgres or MySQL and testing with H2. Now you are testing with real database. Go ahead. Yeah, it would start a new Postgres just for that test execution. Okay. So one last thing, because we don't have that much time, but if you are interested, I have computer, we can sit somewhere after the talk and I can show you all the stuff. One other step that I like personally is this REST data extension. Thank you. This is exactly what I can do in five minutes. So this is basically extension, which is generating REST resources based on your entities, which is, as I learned, 95% of application development in Java is crad over database. So what I can pick here is basically, because I already have JDBC and REST Easy Reactive JSON, I can just copy-paste this ORM REST data panache extension and paste it into my application somewhere, if I can find. Save this. And all I can do now because I always forgot this when I'm talking, so I will just copy-paste entity, panache entity resource, okay. I can just create interface, call it Avenger resource, and this will be interface that extends panache entity resource of my entity and of my type of my ID. Again, I need to give idea and hint that I have a new extension. And that's it. I think that's it, so. Still nothing? Okay, now you work. I will on purpose remove this Avenger here and I will remove this here, so we no longer have, okay, at least I can show you that. If I save the file when it's still not compiling, the mode will not crash. It will just print you the error and give you an opportunity to fix it. So what did I miss? No, this looks good. Good? No, Avenger resource Java. Oh, I have, what am I missing? No, it shouldn't have needs for part. No, this one. This is like Java. Cannot find symbol. Maybe you need, oh, I know what is happening. This will probably not work because I don't have that extension downloaded because this is kind of on purpose that Kvarkus will always do release like one day before I have this talk. And I will run into this kind of issues. So we will give you the second, but basically what this does is basically it will create that CRAT operation resource over our entity that I will pass there out of the box. So now I should still have that Avenger, but now it's coming from the generated resource and you don't need to trust me because, oh, not this one, small array, open API. I will just add a new extension, which I also don't have, probably download it, come on. My computer is somehow sold today, sorry about that. Come on. Okay, any questions? Until my phone internet will go ahead. There is a separate extension for several extensions actually for database migration, we can talk about it later. Now it's taking a little bit more time because it needs to restart the database if I'm adding a new extension because it's a broader, even I'm out of time. Okay, so thank you. I will just show the last one. Just trust me, small array, open API, come on. Where are you? Where is open API? Oh, come on, I cannot find it. Oh, okay, I cannot see it here. Is it there? Okay, let me do it one more. Okay, I don't know what is happening, so I will show it after the talk because we are out of time.