Skip to content

Instantly share code, notes, and snippets.

@AdamBien
Last active April 3, 2017 15:35
Show Gist options
  • Save AdamBien/beae7dd8966a6d57b7225ba310b18abe to your computer and use it in GitHub Desktop.
Save AdamBien/beae7dd8966a6d57b7225ba310b18abe to your computer and use it in GitHub Desktop.
37thAirhacksQ&A.md
@rmpestano
Copy link

Hi Adam,

What solution are you using for mobile applications in your projects? A JavaEE backend and native mobile app or webview (pure cordova or ionic) or something else?

Thank you!

@sergioverde90
Copy link

sergioverde90 commented Mar 30, 2017

Hi Adam, three questions:

  • What is the real usage of javax.ws.rs.ext.ContextResolver? Searching in Google I only see examples about ObjectMapper, can you give us other real useful example?
  • About Docker, ECS and microservices, in your videos you show us how to make a Rest call between microservices using the name of the container, but in ECS (or other cloud provider) when I have a load balancer and multiple containers, what is the name that I should use? How can I refer to this balancer?
  • In the 34thAirhacksQ&A I ask you about how can I have my own CMT transaction and you answer me with javax.transaction.Transactional annotation and CDI. This was very useful for me but how it is implemented a JTA transaction under the hood? Something like Bitronix or JOTM.

Thanks you very much Adam.

@johnhogan
Copy link

johnhogan commented Mar 31, 2017

Hello Adam.

Can you tell us a little about what changes to JEE security we can expect to see in JEE 8 with JSR-375? I see your listed on as a member of the expert group at the JCP. I'm especially interested to know what will become of JAAS, and will it be going away, ...? Thank you.

John Hogan

@jpraet
Copy link

jpraet commented Apr 1, 2017

Hi Adam,

Most of our applications are currently hybrid applications with spring and Java EE mixed together. We are migrating from WebSphere Application Server to a JBoss EAP docker environment (OpenShift), and would like to apply your proposed best practices for the docker deployment model with pure Java EE thin wars and as little 3rd party dependencies as possible.

There are certain areas where we find it difficult to get rid of spring though:

  • spring-security: seems more flexible and straightforward than Java EE security
  • spring-batch: yes, there is JSR352, but this is basically the same as spring-batch without the extensive library of reader/processor/writer component implementations
  • support for the new Java8 Optional and Date API types: in spring this works out of the box. In Java EE 7 you need to write custom converter classes if you want to use these types with JPA / JAX-RS / JAXB / JSF. Will Java EE 8 bring full support for these Java8 types? (I could only find confirmation for JSF 2.3)

What are your thoughts on these?

Thank you!

@MikeEdgar
Copy link

Adam,
I like the idea you have presented of using JsonObject/JsonArray as DTOs in a JAX-RS API, but one downside is the apparent loss of declarative validation. You recently demonstrated using a custom validator for JSON which made use of the programmatic bean validation API. Do you have any suggestions for how one might make use of declarative validation with JSON objects?

Thanks

@davidsoles
Copy link

Hi Adam,
Microservices theory says that each service needs its own database. This statement refers to:

  • One microservice must have one DBMS instance and database.
    screen shot 2017-04-02 at 2 55 00 pm
  • Multiple microservices can share one DBMS instance and every one of then has their own database.
    screen shot 2017-04-02 at 2 54 49 pm
    Thanks.

@AdamBien
Copy link
Author

AdamBien commented Apr 2, 2017

Plain Java SE without Java EE -- is it viable in real world?

(a question from a conference attendee)

@sebargarcia
Copy link

Hi Adam, we are starting a new project with the following stack: JPA + CDI + JAX-RS (for the backend), Angular 2 (maybe with prime-ng) for the client side.
My question is if we have to have all in a single war project (backend + client side) or have two projects one for backend (single war) + other project with all angular stufff.

I see there are some maven plugins to automate all the build process of the angular stuff, but I am not sure if it is good to have all in a single war.

Thanks in advance.

@jcrochavera
Copy link

Hi Audam, could you talk us about your experience with java EE and high performance IOT applications?? (Tips, tricks, most used NoSql databases in your projects,etc)

@walnikster
Copy link

Hi Adam,
Thanks for your blog containing very interesting JEE stuff.
I want to secure my REST API in my JEE application with keycloak. Can you please give a short example of how to integrate keycloak client adapter into payara. I was looking for a client adapter as for wildfly but I was unable to find one for payara.
Thank you
Niki

@kg6zvp
Copy link

kg6zvp commented Apr 3, 2017

Thanks so much for fitting in my student project. I'm building an SDK for Jax-RS microservices.

I've got several entities, corresponding EJBs to work with the entitymanagers and a request filter that needs to be put into an SDK for other students to use to create wars with microservices in them. I'm trying to create a war with a Time microservice that tells time to develop and test the SDK with, but I can't seem to get the SDK inclusion steps down to just declaring a maven dependency. (currently it requires declaring lib/ssauthclient-1.0.5-SNAPSHOT.jar in the Time service in order to avoid an 'org.hibernate.UnknownEntityTypeException', but this results in two persistence modules) What am I doing wrong?

SDK Source: http://gitlab.wmapp.mccollum.enterprises/wmapp/ssauthclient.git

Further detail if you need it:
The request filter and custom Principal classes work just fine, but the JPA entities persisted aren't discovered without using the directive in the persistence.xml of the Timeservice project. I've tried building the beans.xml and persistence.xml files into the SDK jar in Maven, then including them in Timeservice via the pom.xml, which results in two persistence units, but this throws the error 'org.hibernate.UnknownEntityTypeException: Unable to locate persister: edu.westmont.UserToken' when a call is made to a Jax-RS endpoint. The only way I get it to work is by requiring the person creating a microservice to add a directive, but this seems like the wrong solution. Ideally, the included jar would be able to expose it's custom Principal class and Jax-RS filter to the microservice without exposing its entities.

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