Create a gist now

Instantly share code, notes, and snippets.

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

Which way you prefer to work with Angular2 and jax-rs
1- One Single project
2- Two Separate Project
( thanks you are Awesome )

recayi commented Dec 8, 2016

Hello, I'm trying to code a JavaFx program. It will be a kind of Media Slider; but the slider will not only play video but also images slider.

I saw your AudioPlaylist_java example from github. It is really very useful for me.

Basically which I want to do is; there will be files in a directory. These can be "mp4, jpg, png and gif"
files.

Main Player will get the whole suitable files and start to slide them all till the program ends. The images should be visible as time a set for them (i.e 10 seconds)

My problem is; as you remember you are getting the files from Directory as MediaPlayer. I tried to change their type as "File" but many changes needed and I couldn't handle with them.

I'm working with Spring Boot MVN Hibernate for Rest services. I have many technical questions but, mainly I'd like to understand deeper about the architecture of a Rest service for production. I mean, I've made a couple of tuts and check some articles but, I haven't found a good one to understand the aspects I need to cover for a Rest service for production.

enji7 commented Dec 15, 2016

Hi,

in your last Airhacks Screencast, you encouraged your viewers to support your efforts to deprecate / prune SOAP from Java EE.

From my point of view, removing the SOAP-related specs from Java EE would be a pity because of the following reasons:

  1. In our company (as well as in our partner companies), SOAP is still heavily used, especially for B2B communication. Migrating this to an alternative style would be a major effort with questionable gain. I don't know any general statistics on this, but I believe that even though the evolution of the SOAP specs has come to a halt in the past years, there are still a lot of "silent" SOAP users out there.

  2. Even though the SOAP-related specs have their flaws, SOAP is still the better choice than REST in certain situations - see the numerous discussions on "SOAP vs REST" on the web. Some of the most important advantages of SOAP are:

  • rapid client development even for complex applications by generating Java code from the provided WSDL
    • with REST, you have to read the provided documentation first and implement the domain objects yourself (e.g., via JAX-P/B or JSON-P/B)
  • wider range of standardized functionality (WS-* specs of the W3C)

Possible explanations for the laziness of the SOAP-related EE specs are:

  • On the one hand, they already contain an extensive amount of functionality. Hence, it is hard to find big new killer features for extension.
  • On the other hand, the related specs have become quite messy in certain parts (distributed over three JSRs: 109, 224, 181). Hence, it would be hard, painful work to clean them up, with little immediate benefit.
  • From a technical point of view, it is more fun to participate in new, sexy technologies.

Regards,
Nenad

dmn1k commented Dec 18, 2016

Hi,

what is your view on the reports that Oracle is going to "target Java non-payers" ?
Do you think this will harm java's acceptance/popularity and what needs to be done exactly to stay/get license-compliant?

Regards,
Dominik

sergioverde90 commented Dec 20, 2016 edited

Hi Adam,

  1. Working with CDI (no EJB), can I have my own CMT transaction?
  2. I am currently reading a book about performance and tunning (Java Performance: The Definitive Guide by Scott Oaks). I am really interesting about this topic but I think that it is missing a very important thing: Which is the "acceptable" or "normal" throughput in an application? When should we start to worry about performance?
  3. About microservices, how we can communicate multiple microservices without share their DTO's (low coupling?)? In this old post
    (http://www.markhneedham.com/blog/2012/11/28/micro-services-the-curse-of-code-duplication/ )
    Martin Fowler answer it talking about this communication.

Regads. Sergio. Thanks for your work.

dwamara commented Dec 20, 2016

Hi Adam,

there is unfortunately no "JavaEE-provided" way to inject properties from a properties file via CDI (that would be great if this could become a spec) so at the moment I am using deltaspike to do it and it pisses me off a bit because I have to add a jar file with all its dependencies for something that should have been trivial in my eyes.
Is there any way you do it in your own project? I am thinking of using headlands for that but that will mean that I first have to load all the properties in the cache before starting to using them but this will require, as far as I can see, to make a REST call to get the values of the cache, which is IMO trading one overhead for another one.
I read your old article http://www.adam-bien.com/roller/abien/entry/injecting_properties_into_java_ee but that will be a killer to have to implement it in each of my microservices or made from it a jar which will lead me back to the jar (see deltaspike issue above).
Any suggestion?

Regards,
Daniel W.

Owner
AdamBien commented Dec 31, 2016 edited

@AdamBien A tiny thing like that doesn't deserve a space on your blog. I'd like to see something that can compete w/ spring boot/cloud.

— Thai Dang Vu (@dxxvi) December 30, 2016
gbourant commented Dec 31, 2016 edited

Hey Adam and happy new year !

Is it possible to put HTML5 application after the .war has been compiled ?
Because compiling a war with HTML5 application takes a lot of time and without it , it's only few seconds.

I'm using maven.

Thank you!

rac021 commented Jan 2, 2017

Hi Adam,

Oracle has proposed that the Apache Software Foundation take over the Netbeans project. In the proposal, Oracle claims that NetBeans still has 1.5 million developers.

Will the community still as reactive as now ? Some people are optimistic about this, but this is not the case for everyone, especially since Oracle no longer makes Java a priority.

Should will we have to hope for the future of Netbeans ?

Thank you !

oedemis commented Jan 2, 2017

Hi Adam,

Because scalability reasons you discussed in the effective javaee part the bulkhead pattern.
The idea is protecting business services from blocking the app server and business logic through introducing
additional thread pools for http and jdbc.
In reactive style web programming in many blog posts the authors mention that jdbc drivers are always blocking and is not scalable with thread handling and therefore non-blocking database handling are always better.
How is the non-blocking database calls and the bulkhead pattern related ?

Can you also provide a example with a nosql database ?

Thank You

dwamara commented Jan 6, 2017

Hi Adam,

I remember back in the days, the state of Java web applications was quite simple using the MVC paradigm, you had frameworks like Struts for example where you could really separate the design and the backend implementation so that you could outsource the design of the UI to another team or company while the developers could concentrate on the backend and at the end via tags and minimal logic incorporate both of them and you still had the same design and all you wanted.

I stumbled upon a customer who exactly did that, meaning they outsourced the complete design to another company while in-house the logic was built with several microservices glued together via REST because they have not one frontend developer in the company (don't ask me how and why...)

Now the UI is done (a complete click-to-click interface with several pages, forms, texts and all) and now my work should be (in KW4) to present to them a simple and efficient way to glue the backend to the UI, I searched the internet a bit but couldn't find a good approach to it. With the plethora of frameworks nowadays (JSF, Angular, React, etc.), I'm kind of struggling with the right way to deal with this. Any idea what framework would be if not the best, the most appropriate for such a thing?

Kind regards and a happy 2017 to you and yours,
Daniel W.

kgoralski commented Jan 7, 2017 edited

Hi Adam,

Recently I found interesting article about microservices where Spring Cloud and Kubernetes is compared:
https://developers.redhat.com/blog/2016/12/09/spring-cloud-for-microservices-compared-to-kubernetes/

Here is a nice table with comparison:
http://blog-redhatdevelopers.rhcloud.com/wp-content/uploads/2016/12/screen-shot-2016-12-06-at-10-32-19.png

There are "microservices concerns" like:
configuration management, service discovery, load balancing, api gateway, service security, centralized logging, centralized metrics, distributed tracing, resilence & fault tolerance, auto scaling & self healing, packaging, deployment & scheduling, job management, singleton application.

Could you compare Java EE environment to it? or how it can fit to it? or solve such problems?
I guess "it depends" and it is always a matter of scale or maybe we can use kubernetes or something else with Java EE with success?

Thank you

Owner
AdamBien commented Jan 8, 2017

Using Concurrency utilities (JSR-236) in Java EE context:

"...I need to establish communication to a third-party system with socket communication using TCP/IP or UDP both as server and client, so I have to listen on a socket for client messages and also send messages to clients.

Before JEE 7, the standard urged me to write such code in a Resource Adapter using Work threads because I was not allowed to have long running threads in the EJB environment.

Now with JEE 7 and JSR-236, I have the possiblity to get long running threads directly in the EJB environment. So I think it should be possible/allowed to get such a managed long running (never ending) thread and listen on a socket for incoming requests.
..."

dsoles79 commented Jan 9, 2017

I have been working recently with Spring Boot and it is incredibly useful. I offer this technology to clients with small needs and is a very reliable. I guess as an entry point it is a better option than WordPress or PHP. What are your thoughts about this product? I must admit that not having to deal with XML files is a plus. (Convention over configuration). Would you recommend it? Any know disadvantage?

Thanks, Adam.
Big fan of your channel.

kdaham commented Jan 11, 2017

In regards of the HTML5.war + docker question, personally I do something like this (two separate war-builds, one backend and one html5 + js)

o cat Dockerfile
FROM wildfly
COPY backend/build/libs/backend.war ${DEPLOYMENT_DIR}
RUN touch ${DEPLOYMENT_DIR}/gui.war.dodeploy

And then run docker with a mapping to my webapps folder something like this
docker run -d -p 8080:8080 -v $(pwd)/gui/src/main/webapp:/opt/wildfly-10.1.0.Final/standalone/deployments/gui.war:rw

The main reason is that for some reason I write code differently when im in html5/js-mode, more reloads to look at the ui :)
So with this method I have a shorter write/run-cycle with just the idea and a browser window next to eachother.

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