Create a gist now

Instantly share code, notes, and snippets.

Embed
36thAirhacksQ&A.md
@giates

This comment has been minimized.

Show comment
Hide comment
@giates

giates Feb 9, 2017

Hi Adam,
seems that WildFly supports HA singletons in a clustered environment, does Payara support that feature too ? (I can't find any info about this kind of support)...

giates commented Feb 9, 2017

Hi Adam,
seems that WildFly supports HA singletons in a clustered environment, does Payara support that feature too ? (I can't find any info about this kind of support)...

@giates

This comment has been minimized.

Show comment
Hide comment
@giates

giates Feb 10, 2017

Hi Adam,
a question about JMS, is it possible to avoid the JMS message redelivery in case of rollback or system failure ?

giates commented Feb 10, 2017

Hi Adam,
a question about JMS, is it possible to avoid the JMS message redelivery in case of rollback or system failure ?

@McPringle

This comment has been minimized.

Show comment
Hide comment
@McPringle

McPringle Feb 11, 2017

There are plenty of possible solutions out there when I want to take some of my personal (open source) projects to "production". I can use one of the "clouds" or manage an own server (I'm used to server administration). One project is a dockerized Java EE project, the other is realised using Lagom and I want to take a look at ConductR. My projects are not business critical. I don't want to delegate the decision to you but I'm very interested where you base your decisions on. Thanks a lot for sharing your decision basics and your opinion!

McPringle commented Feb 11, 2017

There are plenty of possible solutions out there when I want to take some of my personal (open source) projects to "production". I can use one of the "clouds" or manage an own server (I'm used to server administration). One project is a dockerized Java EE project, the other is realised using Lagom and I want to take a look at ConductR. My projects are not business critical. I don't want to delegate the decision to you but I'm very interested where you base your decisions on. Thanks a lot for sharing your decision basics and your opinion!

@FreifeldRoyi

This comment has been minimized.

Show comment
Hide comment
@FreifeldRoyi

FreifeldRoyi Feb 11, 2017

Hey Adam,
First of all, great blog and videos!

I'm interested in scaling ordered message stream handling (via KAFKA). Basically, FIFO handling of messages.
The problem starts when different topics are in use for different entities (or in the newer event sourcing approach - entity changes), and entity A and B are sent through different topics but have a relation between them.

My first thought was that inbound messages should be partitioned somehow (e.g by id), and from that moment on, the messages should be navigated (by some other service) to a stateless handling service, but that can create a bottleneck and harm the scalability of the entire process.

How can I tackle this issue?

Thnx!
Royi

FreifeldRoyi commented Feb 11, 2017

Hey Adam,
First of all, great blog and videos!

I'm interested in scaling ordered message stream handling (via KAFKA). Basically, FIFO handling of messages.
The problem starts when different topics are in use for different entities (or in the newer event sourcing approach - entity changes), and entity A and B are sent through different topics but have a relation between them.

My first thought was that inbound messages should be partitioned somehow (e.g by id), and from that moment on, the messages should be navigated (by some other service) to a stateless handling service, but that can create a bottleneck and harm the scalability of the entire process.

How can I tackle this issue?

Thnx!
Royi

@AdamBien

This comment has been minimized.

Show comment
Hide comment
@AdamBien

AdamBien Feb 13, 2017

@AdamBien just watched your boundary-ctrl-entity #airhacks video. Where would you place exceptions and other crosscutting things?

— Manfred Pauli (@Soccertrash) February 12, 2017
Owner

AdamBien commented Feb 13, 2017

@AdamBien just watched your boundary-ctrl-entity #airhacks video. Where would you place exceptions and other crosscutting things?

— Manfred Pauli (@Soccertrash) February 12, 2017
@AdamBien

This comment has been minimized.

Show comment
Hide comment
@AdamBien

AdamBien Feb 18, 2017

@AdamBien I have a war file (app.war) and I want to deploy this war into two separeted subfolder at the same wildfly instance. Thanks

— Bruno Santos (@Brunos_Santos) February 17, 2017
Owner

AdamBien commented Feb 18, 2017

@AdamBien I have a war file (app.war) and I want to deploy this war into two separeted subfolder at the same wildfly instance. Thanks

— Bruno Santos (@Brunos_Santos) February 17, 2017
@Pscheidl

This comment has been minimized.

Show comment
Hide comment
@Pscheidl

Pscheidl Feb 20, 2017

Hallo Adam,
you often demonstrate deployments of "thin wars" into a docker container with a Java Application Server inside. These web archives containing nothing but business logic.

In my projects, I often use "helpful" libraries, for example Apache Deltaspike. These represent additional hundreds of kilobytes, if not megabytes of dependencies.

My question
Do you completely omit any additional dependencies besied Java EE ? Or do you deploy them to the AS inside the Docker container, making them a "provided" dependency ? Or is there any other way your projects are built ?

Right now, me and my team are just redeploying the additional libraries every time. Would you recommend the way of "provided" dependecy ?

Thank you,
Pavel

Hallo Adam,
you often demonstrate deployments of "thin wars" into a docker container with a Java Application Server inside. These web archives containing nothing but business logic.

In my projects, I often use "helpful" libraries, for example Apache Deltaspike. These represent additional hundreds of kilobytes, if not megabytes of dependencies.

My question
Do you completely omit any additional dependencies besied Java EE ? Or do you deploy them to the AS inside the Docker container, making them a "provided" dependency ? Or is there any other way your projects are built ?

Right now, me and my team are just redeploying the additional libraries every time. Would you recommend the way of "provided" dependecy ?

Thank you,
Pavel

@vonix2000

This comment has been minimized.

Show comment
Hide comment
@vonix2000

vonix2000 Feb 21, 2017

Hi Adam,

I have two questions:

  1. I used your approach from the Maven BCE-archetype to have a project for system tests (Jersey client / JUnit) to test the REST API of my application, which is deployed on a Payara server. Do you know any way to get the code coverage for such system tests preferably with JaCoCo / Cobertura?

  2. I read your blog post about JSON-P conversion within the entity class. When JavaEE 8 is out with JSON-B, would you still stick to this approach or how would you decide when to use JSON-P vs. JSON-B to expose entities for CRUD operations via REST?
    I like the fact to have full control when using JSON-P and to be flexible when dealing with edge cases. On the other hand there is additional code, which could be avoided with JSON-B.

Thank you,
Simon

Hi Adam,

I have two questions:

  1. I used your approach from the Maven BCE-archetype to have a project for system tests (Jersey client / JUnit) to test the REST API of my application, which is deployed on a Payara server. Do you know any way to get the code coverage for such system tests preferably with JaCoCo / Cobertura?

  2. I read your blog post about JSON-P conversion within the entity class. When JavaEE 8 is out with JSON-B, would you still stick to this approach or how would you decide when to use JSON-P vs. JSON-B to expose entities for CRUD operations via REST?
    I like the fact to have full control when using JSON-P and to be flexible when dealing with edge cases. On the other hand there is additional code, which could be avoided with JSON-B.

Thank you,
Simon

@ptuomaal

This comment has been minimized.

Show comment
Hide comment
@ptuomaal

ptuomaal Feb 22, 2017

Hi Adam,
I am planning tech stack for our new product. I have two main "problems" where I would like to hear your perspective.

First one is bootstrapping the product for different environments (dev, test, different prod envs). Where example Spring boot shines is the concept of different env properties and how easy it is to use (you can example code different bootstrapping logic depending on which environment you are). So which way you prefer to separate dev, test, prod environments in your app and how example you enable some feature just for certain environment (example A/B testing for some feature).

Second problem is UI stack. Our product lifeline (hopefully) will be 10+ years so I want to keep out from the SPA JS frameworks. They change too often and also our product will used for bookmarks and SOME sharing so handling those scenarios in SPA is icky. In history we have made mistake and we went for the JSF 1.0 & 1.1 (before facelets and of course we made our own components too). We are still feeling the pain from it and there is no way I'm going to choose anything related to JSF never again (we also have needs for custom components so using just primefaces is not a solution). I really waited for the MVC for Java EE 8 but now it seems to be out from it? What do you recommend for template based development in Java EE? Or do you prefer JS frameworks even if product life line can be long? My ideal solution would be thymeleaf + JAX-RS but I cannot find a way to do it in Java EE 7-8 without the MVC 1.0.

Thanks for your work to educate us and your efforts to keep Java EE relevant!
-Petri

Hi Adam,
I am planning tech stack for our new product. I have two main "problems" where I would like to hear your perspective.

First one is bootstrapping the product for different environments (dev, test, different prod envs). Where example Spring boot shines is the concept of different env properties and how easy it is to use (you can example code different bootstrapping logic depending on which environment you are). So which way you prefer to separate dev, test, prod environments in your app and how example you enable some feature just for certain environment (example A/B testing for some feature).

Second problem is UI stack. Our product lifeline (hopefully) will be 10+ years so I want to keep out from the SPA JS frameworks. They change too often and also our product will used for bookmarks and SOME sharing so handling those scenarios in SPA is icky. In history we have made mistake and we went for the JSF 1.0 & 1.1 (before facelets and of course we made our own components too). We are still feeling the pain from it and there is no way I'm going to choose anything related to JSF never again (we also have needs for custom components so using just primefaces is not a solution). I really waited for the MVC for Java EE 8 but now it seems to be out from it? What do you recommend for template based development in Java EE? Or do you prefer JS frameworks even if product life line can be long? My ideal solution would be thymeleaf + JAX-RS but I cannot find a way to do it in Java EE 7-8 without the MVC 1.0.

Thanks for your work to educate us and your efforts to keep Java EE relevant!
-Petri

@tobciu

This comment has been minimized.

Show comment
Hide comment
@tobciu

tobciu Feb 26, 2017

Hi Adam,

how do you manage database connections in Docker?
I'm using Tomee and i define the connection as a Resource in /conf/tomee.xml .
But i think, when i use Tomee in Docker, i had to use the same defined connection for stages (automated testing, integration and production).

greetings from Hamburg

tobciu commented Feb 26, 2017

Hi Adam,

how do you manage database connections in Docker?
I'm using Tomee and i define the connection as a Resource in /conf/tomee.xml .
But i think, when i use Tomee in Docker, i had to use the same defined connection for stages (automated testing, integration and production).

greetings from Hamburg

@sergioverde90

This comment has been minimized.

Show comment
Hide comment
@sergioverde90

sergioverde90 Feb 27, 2017

Hi Adam.

I lookup in JSR-346 about javax.inject.Singleton annotation but I did not find anything. In javadoc http://docs.oracle.com/javaee/7/api/javax/inject/Singleton.html I did not find anything. The only reference that I have found is in Weld reference http://docs.jboss.org/weld/reference/2.4.0.CR1/en-US/html/scopescontexts.html. If I deploy this bean in Wildfly:

@javax.inject.Singleton
public class SingletonScope {
	
 @Inject
 BeanManager manager;
	
 @PostConstruct
 void init(){
  Class<? extends Annotation> scope = manager.getBeans(SingletonScope.class).iterator().next().getScope();
   log(scope);
 }
}

The output is 'javax.inject.Singleton'. Then, should I assume that this annotation is supported by CDI or only by Weld?

Thanks you, Adam.

Hi Adam.

I lookup in JSR-346 about javax.inject.Singleton annotation but I did not find anything. In javadoc http://docs.oracle.com/javaee/7/api/javax/inject/Singleton.html I did not find anything. The only reference that I have found is in Weld reference http://docs.jboss.org/weld/reference/2.4.0.CR1/en-US/html/scopescontexts.html. If I deploy this bean in Wildfly:

@javax.inject.Singleton
public class SingletonScope {
	
 @Inject
 BeanManager manager;
	
 @PostConstruct
 void init(){
  Class<? extends Annotation> scope = manager.getBeans(SingletonScope.class).iterator().next().getScope();
   log(scope);
 }
}

The output is 'javax.inject.Singleton'. Then, should I assume that this annotation is supported by CDI or only by Weld?

Thanks you, Adam.

@GADNT

This comment has been minimized.

Show comment
Hide comment
@GADNT

GADNT Mar 2, 2017

Hi Adam

Have you tried to integrate the swagger 1/2 with jersey 1.x? Do you have some sample that works? I am trying to deploy to a Weblogic app that provide jersey 1.18 and it looks that is not able to find the resource class that contains my endpoints. Any thoughts related are kindly appreciated.

Thank you

GADNT commented Mar 2, 2017

Hi Adam

Have you tried to integrate the swagger 1/2 with jersey 1.x? Do you have some sample that works? I am trying to deploy to a Weblogic app that provide jersey 1.18 and it looks that is not able to find the resource class that contains my endpoints. Any thoughts related are kindly appreciated.

Thank you

@deratzmann

This comment has been minimized.

Show comment
Hide comment
@deratzmann

deratzmann Mar 3, 2017

Hi, Adam.
2 questions:

  1. The New payara release has a deactivated autodeployment feature due to Security risks. In many of your docklands projects you actually use this Feature. What is your workaround? Is the New programmatic bootstrap in payara a good alternative?
  2. I experienced long startup times (15-20 seconds) in payara full version with my applications (thin wars, very much use of Java EE APIs, no external libs). As I switched to payara micro, the times were a little bit better (10-15 seconds). What would be a good way to speed up the deployment/startup or to find potential problems?

Hi, Adam.
2 questions:

  1. The New payara release has a deactivated autodeployment feature due to Security risks. In many of your docklands projects you actually use this Feature. What is your workaround? Is the New programmatic bootstrap in payara a good alternative?
  2. I experienced long startup times (15-20 seconds) in payara full version with my applications (thin wars, very much use of Java EE APIs, no external libs). As I switched to payara micro, the times were a little bit better (10-15 seconds). What would be a good way to speed up the deployment/startup or to find potential problems?
@deratzmann

This comment has been minimized.

Show comment
Hide comment
@deratzmann

deratzmann Mar 3, 2017

Thanks :)

Thanks :)

@vasilaio

This comment has been minimized.

Show comment
Hide comment
@vasilaio

vasilaio Mar 5, 2017

Hi Adam,
I have 3 questions:

  1. How we deal with field validation in JavaFX + FXML?
  2. Can you show an example how we test JAX-RS application with Arquillian on different servers by using as a maven dependencies the javaee-api. In my case, with tomee I get java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl. It works only if I use java-ee api from org.apache.tomee.
  3. When we need to Override getClasses/getSingletons of the javax.ws.rs.core.Application class?

vasilaio commented Mar 5, 2017

Hi Adam,
I have 3 questions:

  1. How we deal with field validation in JavaFX + FXML?
  2. Can you show an example how we test JAX-RS application with Arquillian on different servers by using as a maven dependencies the javaee-api. In my case, with tomee I get java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl. It works only if I use java-ee api from org.apache.tomee.
  3. When we need to Override getClasses/getSingletons of the javax.ws.rs.core.Application class?
@yacota

This comment has been minimized.

Show comment
Hide comment
@yacota

yacota Mar 5, 2017

Hi Adam,
I heard you saying that Keycloak is getting more and more popular. When securing applications/services there are different integration strategies, some of them can be found here
https://keycloak.gitbooks.io/securing-client-applications-guide/content/topics/oidc/java/java-adapters.html
Which of them have you used ? (advantages / disadvantages)
Thanks

yacota commented Mar 5, 2017

Hi Adam,
I heard you saying that Keycloak is getting more and more popular. When securing applications/services there are different integration strategies, some of them can be found here
https://keycloak.gitbooks.io/securing-client-applications-guide/content/topics/oidc/java/java-adapters.html
Which of them have you used ? (advantages / disadvantages)
Thanks

@cooljais11

This comment has been minimized.

Show comment
Hide comment
@cooljais11

cooljais11 Mar 6, 2017

Hi Adam,
I have started learning JEE. Your videos and books have been extremely helpful.
I have independent services which needs orchestration. Which framework can I use to do service orchestration in JEE ? Can this service orchestration be a singleton across clusters ?

Hi Adam,
I have started learning JEE. Your videos and books have been extremely helpful.
I have independent services which needs orchestration. Which framework can I use to do service orchestration in JEE ? Can this service orchestration be a singleton across clusters ?

@vasilaio

This comment has been minimized.

Show comment
Hide comment
@vasilaio

vasilaio Mar 6, 2017

Hi Adam,

Thank you for reply, but in second question, about Arquillian, I mean JAX-RS (or JEE) application and not Bean validation.

vasilaio commented Mar 6, 2017

Hi Adam,

Thank you for reply, but in second question, about Arquillian, I mean JAX-RS (or JEE) application and not Bean validation.

@chamisf

This comment has been minimized.

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