Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Created December 7, 2021 09:38
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/2578630397cdab8f07e811627240fa5f to your computer and use it in GitHub Desktop.
Save AdamBien/2578630397cdab8f07e811627240fa5f to your computer and use it in GitHub Desktop.

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

Also checkout recent episode:

93rd 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

@Dzek
Copy link

Dzek commented Dec 10, 2021

Hi @AdamBien,

My question revolves around how EJBs will change in the Jakarta EE 10 and 11 timeframe regarding CDI. For a bit of background, our teams project is pretty old/mature and still uses EJB 2.x + CMP Entities. Our plan is to migrate the Entities to JPA and update the Stateful Session Beans to EJB 3.x. Our general understanding is that EJB isn’t going away but is being enhanced by CDI to be made CDI aware in the future.

Are there any gotcha’s, practices, patterns to avoid when migrating EJB 2.x SFSB to EJB 3.x SFSB that would cause incompatibilities in the future once EJBs are made CDI aware?

Also, will there be a requirement in the future to migrate all EJBs to be CDI Beans?

Thank you very much.

@gunnarpruefer
Copy link

Hi @AdamBien ,
I've got two questions regarding your bce.design template repo (but it's also true for your webcomponents-with-redux.training repo): There are circular dependencies in code:
src\store.js -> src\bookmarks\entity\BookmarksReducer.js -> src\bookmarks\control\CRUDControl.js -> src\store.js
How would you go about these?

There is no bundling on the app itself (i.e. by rollup, which is so far just used on the libs), is there any reason for you not including it and are there any plans to add it in the future?

Thank you very much.

@thehpi
Copy link

thehpi commented Dec 29, 2021

I'm currently using AttributeConverters in JPA to encrypt my fields. However I need context based encryption which means my encryption algorithm needs external data to encrypt and decrypt (and always the same context). This context is NOT stored with the data. The external data is request based (e.g. an order and account number). AFAIK it is not possible to pass context to an AttributeConverter.

So what would be your approach to encrypt and decrypt fields? Of course I can do everything programmatically but then I also need to change my entities what I would like to prevent because then I can re-use them.

Would it e.g. be possible (and efficient) to inject a @RequestScoped bean into the AttributeConverter?

@dabkhazi
Copy link

dabkhazi commented Jan 2, 2022

Adam, please advise how to dynamically change the logging level of a running application / service in the orchestration system (for example, from info to debug), because this requires restarting the container. Write your own mechanism for reading parameters from the database? But this is an extra overhead. Please advise which strategy to use.

@wanderer2097
Copy link

wanderer2097 commented Jan 3, 2022

Can you share your opinion/prediction for 2022 and beyond regarding event-driven architecture? Focusing on the back-end where an event store (such as Kafka) is at the heart and effectively replaces the database as the source of truth for all data. Is it a trend that you think will eventually replace all traditional imperative/CRUD approaches? Or is it a matter of individual use cases where specific requirements (like high scalability or near real-time processing) would drive towards one approach over the other? If so - what would be the killer use cases for event driven vs. traditional "transactional CRUD"?

Happy New Year!

@sm-a
Copy link

sm-a commented Jan 3, 2022

Hi Adam,

how can I reduce/stop the cost risk of excessive resource usage in a DDOS attack on "Google Cloud Run", "AWS Fargate" and "AWS Lambda"?

Thank you

@sm-a
Copy link

sm-a commented Jan 3, 2022

Hi Adam,

for your websites (airhacks.com and others) which hosting provider and which service/package do you use? I have seen from the IP address that it is a product of "Deutsche Telekom". Or an reseller. I'm interested in which one and why you don't use "Google Cloud Run", "AWS Fargate" or "AWS Lambda"?

Thank you again and I wish you a happy new year, much success and health in the new year.

@thehpi
Copy link

thehpi commented Jan 6, 2022

If I start an @synchronous method or run a method using e.g. a managed executor, which context is then available to me inside that method? And how can I access it? e.g. which CDI scopes are accessible? And what about EJB contexts?

So what things will not be possible in such a method that would be possible if I run it inside the same thread?

E.g. if I have @SessionScoped beans can I access them when injected? What about information about the logged in user? e.g. principals?

@haglo
Copy link

haglo commented Jan 6, 2022

We have a SPA.
When the customer calls the SPA then he can see the whole Code (HTML, JavaScript, CSS) in his browser. It is then very easy to refactor our WebApplication.
How can we hide our code in the browser of the customer?

@wanderer2097
Copy link

When requesting HTTP PATCH on Java 17 (JAX RS client) using the I get: java.net.ProtocolException: Invalid HTTP method: PATCH
The same does not happen on JDK 11. The new HTTPClient does not seem to support PATCH at all.

How do you work around this problem? Is using the HTTP method override in the request header the only option?

@senleft
Copy link

senleft commented Jan 9, 2022

Hi Adam,
If my goal is to avoid using the JPA on a project as developers need to know what is going under the hood to exclude performance issues.
As a JPA alternative, it could be a plain JDBC, JPA native query.
Spring ecosystem has the jdbcTemplate library.
What would be your recommendation for writing SQL (including the "database-specific SQL" use case) on the Microprofile stack with Quarkus?
Regards, Aleksandr T.

@BreDenro
Copy link

Hi Adam, my question is about GlassFish vs Payara. I thought the name GlassFish was abandoned and continued as Payara. But now many new GlassFish versions are coming out and they have more updated components and support new JDK versions. Like I tried compiling Payara on JDK 17 and JDK 11, but it failed all the time. GlassFish compiles without issues on JDK 17.

Can you tell us more about how they relate now?

@dwamara
Copy link

dwamara commented Jan 10, 2022

@sm-a if I remember well from back in the days, @AdamBien hosts his websites in his basements on his own server. I remember that he used to post specs (and sometimes pictures) of the configuration of his servers when he bought or upgraded some of them.

@dwamara
Copy link

dwamara commented Jan 10, 2022

@BreDenro Payara is fully based on the open source Glassfish for which you can have a enterprise level technical support, it came to life after Oracle ceased to provide technical support for Glassfish and since support is very important for entreprises, Payara was born and is fully Glashfish-based.

@BreDenro
Copy link

@dwamara the only difference between Payara and GlassFish is the support option?

@dwamara
Copy link

dwamara commented Jan 10, 2022

@BreDenro the main difference yes, that was what brought them to the market then they added some other features but as said, they are based in glassfish.
In case you would like to see more features, you can visit this page but it was for the version 5, no idea what they now have since I completely moved from payara micro to quarkus when it got out: https://www.payara.fish/glassfish-vs-payara-server-5

@comdotlinux
Copy link

comdotlinux commented Jan 10, 2022

Hey Adam,
We have an interesting use case that might be a good fit for Message Queues,
An application needs to call around 5-7 operations(web hooks) per event on some write to the database, these writes could be around 2000 per hour and we need to individually retry the web hooks if they fail. Do you think that it is overkill to use a message queue? Would you recommend setting it up (the queue) ourselves or use some hosted solution?
We are using Aws for most of our hosting.

What we don't need is persistence (hence not Kafka) but reliable messages that we can after a successful external call we can say (OK this one is processed) however since this is not the core application but some external services that if are failing should not interfere with the actual code hence I was thinking no simple query for the list of hooks and call them.
Also did you recently use JMS? Do you know any recent changes?

Thanks in advance,
Guru

@comdotlinux
Copy link

Did you have a look at hasura? https://hasura.io/ its very interesting to give crud from a Database + fine grained row + column access control using roles-> what is your experience with graphQL?

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