Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created September 8, 2020 12:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdamBien/50822397755deac85c9f5bd39b334b57 to your computer and use it in GitHub Desktop.
Save AdamBien/50822397755deac85c9f5bd39b334b57 to your computer and use it in GitHub Desktop.
79thAirhacksQ&A.md

Ask questions and see you at October, 5th, 8.PM. CET: https://vimeo.com/event/154379

Also checkout recent episode:

78th 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

@enji7
Copy link

enji7 commented Sep 9, 2020

Hi,

thank you very much for your review of Jareto in the last Airhacks episode - it has highlighted
several gaps in our documentation, which we have addressed in the meantime:

  • exceptions are serialized to JSON, which means that they are also easily consumable by non-Java clients
  • we use JSON instead of HTTP headers for exceptions because this allows us to transport structured data if necessary (the actual data is customizable)
  • the client-side part uses ThreadLocals instead of @RequestScoped to also support standalone applications; the ThreadLocals are automatically cleared in the provided filters

Regards & happy hacking,
Nenad

@civitz
Copy link

civitz commented Sep 17, 2020

Hi,

I was listening to your (very interesting) podcast episode with Emily Jiang, where you also talked about configuration in the jakarta EE / MicroProfile environment.
You mentioned one may need to get a list of all possible configuration keys and values but they are disseminated along the code.

I made a library, which targets old java EE 6, that partially addresses this problem.
It forces/lets you list all your configuration in an enum and then it generates an injector and a custom annotation. With this approach, you can only inject properties that are listed in the enum, and since it supports validation, you can be sure the properties are valid.

The library itself is barebone and not very flexible, but it works in production and it has saved me some headache.
It should be easy to provide configuration source that reads values from microprofile config or similar.

You can find it here https://github.com/civitz/viper

@robert-niestroj
Copy link

Would you recommend Quarkus for building monoliths?

@djafaka
Copy link

djafaka commented Sep 21, 2020

Hi Adam
Thanks for this useful project.
I wondering if there is a planned feature for WAD to detect the change in the docker image and rebuild automatically like the source Java code ?
Many thanks for your response and thanks for your Java Passion !
Karim

@alibttb
Copy link

alibttb commented Sep 28, 2020

Hi Adam

_btw my name is Ali then comes b.t.t.b ;-) _

My Question is:

How to make the thin war as portable as possible regarding database access:

  1. data sources definition is done in different ways in Payara/Glassfish vs Wildfly!!
  2. JDBC connector is deployable to Wildfly but needs some other config in Payara/Glassfish!!

Many thanks

@AlexeyMalkovskiy
Copy link

Hi Adam,

What do you do in cases when you have to include some build related information (build number, build date etc.) into an application?

Thank you.

@vaibhavkulkarni
Copy link

vaibhavkulkarni commented Oct 1, 2020

Hello Adam,

How do I implement custom bulma css styles in every web component in my app? I basically want the themed css created using bulma to be applied to all lit-element web components in my app.

Thanks,
Vaibhav

@varijkapil13
Copy link

Hi Adam,

We recently switched to JWT authentication using Microprofile and Payara. It works great with JAX-RS endpoints. But we also have some Websockets in our apps and so far there is nothing in MP that would authenticate Websocket connections, we had to create a webfilter for the this and use another library to verify the JWT. Is there a better approach until/if the support for Websockets comes to MP?

Thanks!

@FlorinAlexandru
Copy link

Hi Adam,

How to update an injection point? Assume that we have a producer method that returns a type. Based on some business logic, I want to change the value of the injection sometimes at runtime.

I know that I can use Instance<MyBusinessClass> injected and injcted.get() but is there a visible penalty for creating each time a new instance? Are there any other solutions?

Thank you,
Florin

@aldolushkja
Copy link

Hello Adam, it's the first time I write in your Gist I hope to be as concise as possible and thank you very much for your tutorials and courses, you are a guru to me.

Question 1: Often/always in our projects happen to have configurations (url for database connections, properties of connections to queues, simple application FLAGs, etc. ) in a table of "configuration" within databases, configurations that are typically encapsulated within Bean Singleton and loaded when the application starts with a call to database and column mapping -> class attributes. Often the need arises also to do a hot refresh of such configurations in case one of those flags changes, so the idea was to expose a dedicated service only for the refresh of the Singleton bean. Do you consider that a good approach? Would you have a valid security option to encapsulate this information without having to resort to databases?

Question 2: Considering that the scenario at question 1 , is mainly due to the deploy environment with Tomcat, migrating such applications to WildFly I was thinking of using the Microprofile specifications in full, specifically MicroprofileConfig for injecting values ( url db , url queue, application flags etc...) directly from properties files. But I think the customer won't be happy about it, considering that some of that data is still within the source code. Do you have any idea how to use this specification in cases like the one mentioned above?

Thank you again, great job

@thehpi
Copy link

thehpi commented Oct 5, 2020

How can I unittest a JNDI lookup that I do in payara?

@xwoker
Copy link

xwoker commented Oct 5, 2020

Hi Adam,

in your latest web dev video course your putting the whole redux state into local storage. What would be your approach if I want to put parts of the redux store in local storage and other parts into session storage? Two different top level objects and filtering?

Thanks for the great video courses.

Christian

@franden
Copy link

franden commented Oct 5, 2020

Hello Adam,

  • which annotation do you usually use in your quarkus projects to ensure that a bean is discovered by CDI container? @dependent, @RequestScoped ...? Or do you even use more manual bean instantiation where no other resources must be injected via CDI?

  • which JVM do you use in your projects to run your application/application server, or which is more stable according to your experience? OpenJDK? Build of a specific vendor? Hotspot/OpenJ9?

Greetings
Denis

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