Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created November 3, 2021 04:47
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/ea678489163f90a4bed43dbfeb4d97b6 to your computer and use it in GitHub Desktop.
Save AdamBien/ea678489163f90a4bed43dbfeb4d97b6 to your computer and use it in GitHub Desktop.
93rdAirhacksQ&A.md

Ask questions and see you at December, 2nd, 8.PM. CET: youtube.com/c/bienadam/live

Also checkout recent episode:

92nd 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

@AdamBien
Copy link
Author

AdamBien commented Nov 3, 2021

Are any limitations to use the Java CDK vs using the Cloud Formation directly? (by Aleksandr, after a DevTalks session)

@jefrog1844
Copy link

jefrog1844 commented Nov 19, 2021

I've been following your talks (most recently devoxx and microstream) on running "serverless" with AWS Lambda and Java. You mentioned in a recent talk that a monolith with 25-50 classes or so could be deployed as a Lambda. How would a jax-rs application with multiple resource classes (boundaries) be configured/deployed as a single Lambda?

@HiMyNameIsIlNano
Copy link

HiMyNameIsIlNano commented Nov 21, 2021

Hi @AdamBien,

could you please explain me the differences between the following three annotations:

If @singleton means that every client that uses that bean receives the same (and only) instance defined in the DI container why was it necessary to define the annotation @ApplicationScoped? In what are @singleton and @ApplicationScoped different? Also, I find it very hard sometimes to decide if my beans should be singletons or stateless because to me they sound the same. I read the documentation several times but somehow the explanation did not resonate to me very much. Could you please tell me how these annotations differ from each other?

Thanks in advance!

@HiMyNameIsIlNano
Copy link

HiMyNameIsIlNano commented Nov 21, 2021

Hi @AdamBien,

I very often make use of an EntityManagerProducer class and annotate the method that returns the EntityManager with @produces so that I can inject the produced bean in other beans. This way I can use constructor injection and simplify my life when writing unit and integration tests because I am free to define whatever persistence unit I want.

I have read several times, however, that the EntityManager is not thread safe and I was wondering two things:

  • what are the implications of the entity manager not being thread safe? What kind of issues can I incurr into if I inject it into several other beans and not paying attention to thread safety?
  • how can I correctly produce the entity manager in a way that it is thread safe?

Thanks again.

@jefrog1844
Copy link

jefrog1844 commented Nov 23, 2021

When trying to use your template aws-quarkus-lambda-cdk-plain, it took several hours to get it to deploy due to a bootstrap issue.

I finally found the following worked to properly bootstrap the app:

export CDK_NEW_BOOTSTRAP=1
cdk bootstrap aws://ACCOUNT-NUMBER/REGION

Evidently the "modern" template is required for bootstrap and the above command configures it correctly.

Can you explain how to properly setup aws cdk/lambda via bootstrap and config and if an IAM user is required?

Thanks much

@alibttb
Copy link

alibttb commented Nov 24, 2021

Hello sir,

What is your approach to development, test, production stages when it comes to persistence.xml file, how do you use the schema creation feature, and how to protect production from deploying some artifact with a wrongly attributed persistence.xml where javax.persistence.schema-generation.database.action is set to drop-and-create option?

Thank you very much.

@dabkhazi
Copy link

Hey! What do you think of the one container one process approach? And multithreading is taken over by the orchestration system through the creation of the required number of containers. Is this approach good for Java applications?

@dabkhazi
Copy link

The microprofile fault tolerance api will allow us to limit the number of concurrent calls to our business method with Bulkhead annotation. Is it possible to use the same annotation for the microprofile rest client method in interface definition?

@dabkhazi
Copy link

Graviton and Ampere will reduce the cost of cloud services?

@franden
Copy link

franden commented Dec 6, 2021

Hi Adam, thanks for the great Q&A sessions.

Since your Devflex session "Hey Enterprise EJB Developers Now Is The Time To Go Serverless" I can't get this topic Serverless Computing out of my head. I have already migrated parts of our modular monolith (Jakarta EE 8) to Quarkus as part of a POC and tried it out as an Azure Function. It was very exciting and interesting.

I would be interested if it is realistic to migrate a modular monolith completely to Serverless. Do you have any experience with such projects?

Can you possibly show an example how the orchestration of such a serverless architecture in production can look like? Communication between the functions, 0-downtime deployment etc.

Greetings
Denis

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