Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Last active March 6, 2023 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/3eba2c0cee3c6e2722cd6c3d440d9bef to your computer and use it in GitHub Desktop.
Save AdamBien/3eba2c0cee3c6e2722cd6c3d440d9bef to your computer and use it in GitHub Desktop.
108thAirhacksQ&A.md
@sleski
Copy link

sleski commented Feb 11, 2023

Hi Adam,

in java 11 was added HttpClient, which you use in this example (https://www.adam-bien.com/roller/abien/entry/sending_a_json_document_via). I am using this client very often, but still have a question, what is a proper way to consume json from the response? In HttpResponse.BodyHandlers we can chose from ofString(), ofFile(), ofInputStream() and few more, but we do not have any way to have just json. Even in jdk 17, we do not have this possibility. I found this Question and Answers (https://stackoverflow.com/q/57629401/865448) but it looks like kind of workaround.
So my question is: what is a nice a recommend by you way to do this (get response as json)?

Kind regards!

@AdamBien
Copy link
Author

"I'm a bit confused with the low level design principle of Liskov substitution principle. I do understand what it is but still not sure how it is useful in any way" [ a question from: https://discord.gg/airhacks]

@alexnerd
Copy link

Hi, Adam!

If we look at the Response class(https://jakarta.ee/specifications/platform/8/apidocs/javax/ws/rs/core/response), we will see that it implements the AutoCloseable interface, do we need to explicitly close the responses or use try-with-resources, I have never seen anyone do this, can there be a resource leak here?

Thank's!

@dwamara
Copy link

dwamara commented Mar 2, 2023

Hi Adam,

long time no writing from me, just too busy but always watching the sessions on YouTube after they air.
A quick question: is there an elegant way to find the name of the method one is in?
At the moment I do this
var action = (this.getClass().getSimpleName() + "." + getInstance().walk(frames -> frames.findFirst().map(StackFrame::getMethodName)).get());
but I definitely don't find it elegant and code must be performant and elegant.

Thanks again,
D.

@dabkhazi
Copy link

dabkhazi commented Mar 6, 2023

Hello! You use the Quarkus framework a lot, it's a fast growing framework with very frequent updates. Do you often return to old projects to upgrade the version of the framework in them?

@losch
Copy link

losch commented Mar 6, 2023

Hi Adam,

Thank you for the show!
I recently deployed a small Quarkus application to AWS Lambda as a monolith function and so far it has been working great and it's easy to maintain. Also it's nice that we can switch to Fargate easily if we ever need to. Do you have any experience on how big the monolith functions can be? Is there any limit in practise?

@dempile
Copy link

dempile commented Mar 6, 2023

Hi Adam,
How could you protect your war from being decompiled ?

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