Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
76thAirhacksQ&A.md

Ask questions and see you at July, 6th, 8.PM. CET: https://vimeo.com/415639656

Also checkout recent episode:

75th 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.

@imrel

This comment has been minimized.

Copy link

@imrel imrel commented Jun 7, 2020

What are your thoughts on Jakarta MVC and it's future?

To me it feels like it would have been appropriate to standardize over 10 years ago, but now is just adding overhead to Jakarta as industry has moved on from this kind or programming model.

@rdehuyss

This comment has been minimized.

Copy link

@rdehuyss rdehuyss commented Jun 12, 2020

I would love a review of JobRunr, a distributed job scheduling library which utilizes plain lambdas for fire-and-forget, delayed and recurring jobs.

You can find it at https://github.com/jobrunr/jobrunr.

@rdehuyss

This comment has been minimized.

Copy link

@rdehuyss rdehuyss commented Jun 15, 2020

How to create a bean without xml in MicroProfile?

Is something like this possible?

@ApplicationPath("/jobrunr")
public class JobRunrExampleApplication extends Application {

    @ApplicationScoped
    public JobScheduler jobScheduler(StorageProvider storageProvider) {
        final JobScheduler jobScheduler = new JobScheduler(storageProvider);
        BackgroundJob.setJobScheduler(jobScheduler);
        return jobScheduler;
    }
...
}

Found it:

public class JobRunrProvider {

    @Produces
    @Singleton
    public JobScheduler jobScheduler(StorageProvider storageProvider) {
        final JobScheduler jobScheduler = new JobScheduler(storageProvider);
        BackgroundJob.setJobScheduler(jobScheduler);
        return jobScheduler;
    }
...
}
@AlexeyMalkovskiy

This comment has been minimized.

Copy link

@AlexeyMalkovskiy AlexeyMalkovskiy commented Jun 23, 2020

Hi Adam,
Could you make some summaries about testing BCE-based applications. I remember you mentioned about testing classes in the Boundary. But what about Control? Also I saw even separate projects for tests.

@AlexeyMalkovskiy

This comment has been minimized.

Copy link

@AlexeyMalkovskiy AlexeyMalkovskiy commented Jun 24, 2020

One more question about testing. If you have to test some private method in some service class, is it Ok to make it package visible or move it to some control class and write test to this control?

@robert-niestroj

This comment has been minimized.

Copy link

@robert-niestroj robert-niestroj commented Jun 26, 2020

Whats the best way to share constants between Java Backend and a JavaScript frontend? I have a few Java enums in my Backend, which i would like that my JS Frontend would use to avoid duplication or mismatches.

@m1k0-registered

This comment has been minimized.

Copy link

@m1k0-registered m1k0-registered commented Jun 26, 2020

Very important in productivity is testing, but JakartaEE has no support by platform. In SpringBoot we can create test (Integrating Testing) by simple adding @springboot and everything important for test are launching.
Simply entermvn clean varify. We can focus only on business logic.

I know, that you resolve this task by creating another project for System Testing, but this is very inconvenient.
Some very big framework is Arquillian, but it has no support for Junit 5. Seems to be not alive.
I failed with trying simple test :(

Main questions: How to test rest endpoints? JPA with database in memory? CDI? Jms?

@vanuatoo

This comment has been minimized.

Copy link

@vanuatoo vanuatoo commented Jun 28, 2020

In Java EE 8 Applications we typically use JAX-RS with Stateless EJBs.
In Quarkus what would be the correct scope for @stateless? @RequestScoped or ApplicationScoped?

@dempile

This comment has been minimized.

Copy link

@dempile dempile commented Jun 29, 2020

Hi Adam,

  • I hava manage to make the hazelcast cache on Payara Micro work properly in okd with your docklands image S2I Payara Micro updated from 5.192 to 5.201. All the @RequestScoped and @ViewScoped work but when using the @ApplicationScoped I have a problem with the serialization of the class. How can i avoid this kind of problem. I know tha hazelcast is a proprietary solution and you like the standard but I didnt found another way to make a distributed cache and I need for the scalling.

  • How to make an application without @singleton and @ApplicationScoped or if necessary how to replace them.

Thanks

@WassimAkachi

This comment has been minimized.

Copy link

@WassimAkachi WassimAkachi commented Jun 30, 2020

Hi Adam,

  1. Is it possible to build a multi-tenant Jakarta EE 8 / MicroProfile app, so that each Tenant has its own database/database-schema?

  2. How to switch dynamically at runtime between different databases/schemas for each http-request (via WebFilter / ThreadLocal)?

  3. Is it possible to switch dynamically at runtime the entity-manager and transaction-manager per request? Can you show us a PoC?

Thanks
Wassim

@brunogptavares

This comment has been minimized.

Copy link

@brunogptavares brunogptavares commented Jul 3, 2020

Hi Adam,

How can I reuse JPA entities across multiple projects?
Can I put entities in a maven module, what dependencies and configurations are needed?

Thanks
Bruno

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Jul 3, 2020

Hi Adam,

What is the basic difference between a Jakarta EE and a microprofile server (e.g. micronaut, e.g. payara micro)? Yes, the micro is small and the full is big; but, what's missing from the micro?

Kind regards,
John

@szymonk92

This comment has been minimized.

Copy link

@szymonk92 szymonk92 commented Jul 6, 2020

Hi Adam,

In my project, we use pretty complicated Access Policy which for every entity has a user and group rights. Groups might be predefined as well as created by the administrator user. So for every entity user or group (or both) can have READ/WRITE/OWNER rights. This approach requires 2 additional tables for every entity (+additional 2 for Envers) and has multiple joins. Do you know any better way to manage rights for entities? I was wondering if we could use KeyCloak to help us with that, however not sure if we can use User and Groups policies together. What's your opinion on that?

Thanks
Szymon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.