Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created March 8, 2022 12:04
Show Gist options
  • Save AdamBien/bbb339de1eaf5bb4fec337a2bf4b7673 to your computer and use it in GitHub Desktop.
Save AdamBien/bbb339de1eaf5bb4fec337a2bf4b7673 to your computer and use it in GitHub Desktop.
97thAirhacksQ&A.md

Ask questions and see you at April, 4th, 8.PM. CET: youtube.com/c/bienadam

Also checkout recent episode:

96 airhacks.tv

Please keep the questions Jakarta EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions. Upcoming airhacks.tv events are also going to be announced at meetup.com/airhacks

@ylberi51
Copy link

ylberi51 commented Apr 3, 2022

Hi Adam,

I'm having difficulties understanding some concepts about request handling in Quarkus. Can you please explain differences of request handling in Quarkus when using:

  1. RESTEasy
  2. RESTEasy Reactive
  3. Reactive Routes.

I've read some "under the hood docs" of Quarkus architecture. It tells that request handling in Quarkus is by default "reactive" (using Vert.x). Okay till here. I mean, I thought now I understand how Quarkus works. But then I start reading more about how you can use RESTEasy Reactive extension and make your request handling "reactive". What "reactive"!!! Does not Quarkus by default handle requests "reactive" (vert.x)?? That's not all. I then read about Reactive Routes, how you can make Quarkus more "reactive" 😃 😕

Can you please explain (maybe with some simple drawings about request handling in Quarkus) how these three extensions make your application "reactive". What are IO and Worker thread and how Quarkus handle requests in these threads when using those three extensions.

What about Project Loom? I'm reading now about the "new virtual threads" that will come to Java. It says that Project Loom will "kill" reactive libraries. Can you talk something about this project and how it will replace or deprecate reactive libraries.

Sorry about my (long and maybe silly) question. I'm still a non-experience young man, who just graduated and I'm trying to understand more about JavaEE/JakartaEE and Quarkus and how some things work "under the hood".

Thank you so much for all the answers Adam

@ylberi51
Copy link

ylberi51 commented Apr 3, 2022

One more question Adam 😃

When using for e.g. Quarkus to build serverless lambda functions (aws), is it better and faster to always build native images using graalvm and deploy to lambda as native, or just deploy as standard jvm?

Are the native functions always faster than jvm functions, in terms of:
start time (better cold start),
throughput ->better response time

Thank you once again!

@billy-lgtm
Copy link

Hello Adam

Can you talk something about differences between Quarkus and Micronaut. They are both reflection-free, right? And while reading in Micronaut docs it says that Quarkus is not full reflection free.
From micronaut docs: "even Quarkus currently only implements reflection-free DI and not AOP"

So, when using @interceptor in Quarkus, does Quarkus use reflection, and if you use Micronaut AOP, everything is reflection-free.

And one question regarding the "famous topic - dependency injection type". Quarkus docs prefer the package-private field injection and Micronaut constructor injection. Any reason why so? Is it ok to use package-private fields in Micronaut also?

Can you please explain these, and maybe any other differences between the two frameworks? Which one do you prefer and why?

Thanks a lot

@Endilicam
Copy link

Hi Adam,

another question ;), is about security in an application with REST architecture and web frontend.

The initial approach is to use the groups of a JWT token and the @RolesAllowed annotation in the backend, but if I want to make it dynamic I have chosen to have a database table to configure the permissions and a RequestFilter where to perform the validations.

The first problem is maintenance, it would have to have the allowed groups/roles for each endpoint.

The second, that due to functional requirements, the possibility of a menu option being read-only is requested, the problem is the navigation between screens since it has to be inherited between screens, but being a REST architecture (stateless) I do not see how to do it without compromising security, I don't know if I explained myself well.

In the end, the goal is that a user, even if authenticated, cannot call all the endpoints, only those that have permissions, but without the management being so complicated, the only way I can think of is to put security per endpoint although it is difficult to maintain, is there any other approach?

@eimanavicius
Copy link

eimanavicius commented Apr 4, 2022

I have Struts 1.x application. I want to migrate to more modern framework.

One option is Struts 2.x. How would you execute such migration?

Is there a reason to migrate to MicroProfile application. What would that mean? What would be benefits? Would that mean rewrite of templates to SPA + API? How would you execute such migration if it is meaningful?

Is there any Java API spec that would help for easy maintaince or cheap upgrades to such systems?

Can you comment on Jakarta MVC as contract https://projects.eclipse.org/projects/ee4j.mvc ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment