From the course: Learning Quarkus
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Fizz Buzz
(upbeat music) - [Instructor] And now, here's my solution to the challenge exercise. So I solved this problem with two class files and some changes to the application.properties of a brand new application. So I went ahead and created a FizzBuzz application, and in the CommandRunner class that I created, I annotated it with QuarkusMain on line 10. You will see that I implement QuarkusApplication on line 11. I also have a private instance of FizzBuzz and a private static final Logger. Now, I inject into the constructor an instance of FizzBuzz, and then I'm going to use that in our Run method along with a LOG.debug statement telling us that we're starting, and a LOG.debug telling us that we're ending. That way, we complete those parts of the requirements. Now, in the FizzBuzz execution method, you'll see that I have this ApplicationScoped. That way, I can inject it in on line seven. And then, on line 10, I create a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Welcome to Quarkus5m 31s
-
(Locked)
Introducing the docs4m 40s
-
(Locked)
Starting a project6m 44s
-
(Locked)
Dependency Injection in Quarkus6m 48s
-
(Locked)
Command mode Quarkus5m 13s
-
(Locked)
Configuration properties in Quarkus5m
-
(Locked)
Logging in Quarkus4m 39s
-
(Locked)
Challenge: Fizz Buzz1m 36s
-
(Locked)
Solution: Fizz Buzz4m 6s
-
-
-
-