Skip to content

Instantly share code, notes, and snippets.

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

Ask questions and see you at September, 2nd, 6.PM. CET: http://www.ustream.tv/channel/adambien

Also checkout recent episode:

65th airhacks.tv

Please keep the questions Java EE-stic. Means: as short and as concise as only possible. Feel free to ask several, shorter questions.

@matlach

This comment has been minimized.

Copy link

matlach commented Aug 9, 2019

Hi Adam,

Micro-profile provides really nice API and features though, it's not always fully available in application server. For example, Wildly 17 which released very recently, doesn't yet support Micro-Profile OpenAPI.
To your knowledge, is there some common/standardized way across the various Micro-Profile (api or vendor) to do this?
Do you have any examples on "how to bootstrap" within an Application Server a missing micro-profile?

In my case, I'm especially interested about OpenAPI to remove my Swagger dependency. Do you think that replicating what Thorntail does, i.e. using a standard Servlet, could do the trick?
https://github.com/thorntail/thorntail/blob/master/fractions/microprofile/microprofile-openapi/src/main/java/org/wildfly/swarm/microprofile/openapi/deployment/OpenApiServletContextListener.java

Thanks a lot for your time, and as always, keep up the good work.

@thatsIch

This comment has been minimized.

Copy link

thatsIch commented Aug 14, 2019

Hi Adam,

we have a business constraint that a value should not drop below 0. The value is calculated on the fly based on a set of entries. We offer a JAX-RS endpoint to allow adding entries but if the account drops below 0. Imagine just a basic bank account where you have 50€ and you can book as long you have enough funds on your account.

Some clients started to replay their POST requests and dropped below 0€ because of race conditions,
because when the request was posted they had enough funds. How can you prevent that? Obviously, we told the clients to stop that, but we want to protect the business constraints on our side, too.

Love from Essen, DE

@dempile

This comment has been minimized.

Copy link

dempile commented Aug 20, 2019

Hi Adam,
In the comunication between two microservices , you said that we should copy paste the entity in the two, how would you implement the outbox transactional pattern in order to notify other microservices that data has changed.
I know that you dont like using third party libraries but what do you think of the combinaison of Debezium and Kafka. Is there any alternatives?
Thanks

@markus4zander

This comment has been minimized.

Copy link

markus4zander commented Aug 21, 2019

Hi Adam,

in your screen cast here you get a browser warning about using "document.write" when using a web component with lit-html. How do you handle (or ignore) this warning in real projects?

Thanks
Markus

@Tunjidir

This comment has been minimized.

Copy link

Tunjidir commented Aug 21, 2019

Hi Adam,

we have a business constraint that a value should not drop below 0. The value is calculated on the fly based on a set of entries. We offer a JAX-RS endpoint to allow adding entries but if the account drops below 0. Imagine just a basic bank account where you have 50€ and you can book as long you have enough funds on your account.

Some clients started to replay their POST requests and dropped below 0€ because of race conditions,
because when the request was posted they had enough funds. How can you prevent that? Obviously, we told the clients to stop that, but we want to protect the business constraints on our side, too.

Love from Essen, DE

Hi thatslch, you should try using a constraintvalidator, with a single annotation and a class that implements that ContraintValidator. you can validate the request on the fly when it's been passed as a POST request body.

@sgulci

This comment has been minimized.

Copy link

sgulci commented Aug 21, 2019

Hi Adam,

Are you using minishift or okd origin for your local test? which are you recommend

thanks
Sahin

@Tunjidir

This comment has been minimized.

Copy link

Tunjidir commented Aug 22, 2019

HI adam in this blog post you wrote sending an inputstream to jaxrs you showed how to send an inputstream to jaxrs resource, assuming i was sending this from the front end as a POST request using javascript's fetch api. how do i parse the image as an input stream?

@Tunjidir

This comment has been minimized.

Copy link

Tunjidir commented Aug 22, 2019

Hi adam, what is Odata and is the apache library olingo an implementation?. do you think it's useful in projects or it's an absolute overkill?

@FreifeldRoyi

This comment has been minimized.

Copy link

FreifeldRoyi commented Aug 24, 2019

Hi Adam,
What is the best alternative to injecting ManagedExecutorService, in Microprofile? In Quarkus?
Also, when injecting MES, some default queue and pool size is given by the application server, while now (I think) I have to configure everything by myself. How would you suggest doing that ? and how to determine the values?

Thank you !

@altuga

This comment has been minimized.

Copy link

altuga commented Aug 25, 2019

Hello Adam

I'm reading "The Effective Java" book by Joshua Bloch and in that book author advice to use immutable classes.
For example :

public **final** class Complex {
    private **final** double re;
    private **final** double im;

    private Complex(double re, double im) {
        this.re = re;
        this.im = im;
    }

    public static Complex valueOf(double re, double im) {
        return **new Complex(re, im);**
    }

    public static Complex valueOfPolar(double r, double theta) {
        return **new Complex(r * Math.cos(theta), r * Math.sin(theta));**
    }

    // ...
} 

What is your advice about combining Effective Java 's immutable approach and Java EE ?

Regards from Java User Group Istanbul

@Tunjidir

This comment has been minimized.

Copy link

Tunjidir commented Aug 28, 2019

Hi Adam,

What should a JavaEE developer know in 2019?
Tips for JavaEE developer interviews?
Thanks

JAX-RS, CDI, EJB's & JPA and you're pretty much good to go.

@t-shaguy

This comment has been minimized.

Copy link

t-shaguy commented Sep 1, 2019

Hi Adam,
Please are there limitations to forking code based on GPL3? I want to know the implications if I plan to go commercial with my own version

@dkrtic

This comment has been minimized.

Copy link

dkrtic commented Sep 1, 2019

Hi Adam,

can you explain or even better show us how you use jwtenizr for intergration tests in Jenkins.
Thanks!

@nkengasongatem

This comment has been minimized.

Copy link

nkengasongatem commented Sep 1, 2019

Hi Adam,

Please how can I use an application server (e.g Payara) with docker to deploy a .ear ?

Thanks

@aledestasio

This comment has been minimized.

Copy link

aledestasio commented Sep 2, 2019

Hi Adam,

just to stop from boring you with technical questions.....a business related question :-)

Let's say that someone tomorrow want to start a small business for consultancy/development on Java/JakartaEE platform.

What's your vision about the billing model? Time-based (risk on client) or feature based (risk on provider)? And in this latter case do you have any suggestions about the most effective (pragmatic) way to deal with the issue of work estimates?

Thank you and I hope to come at airhacks in December...

Alessandro De Stasio

@AdamBien

This comment has been minimized.

Copy link
Owner Author

AdamBien commented Sep 2, 2019

@t-shaguy

This comment has been minimized.

Copy link

t-shaguy commented Sep 2, 2019

Hi Adam,

Please do you advice developing a securities trading solution in PHP? I mean is PHP battle tested enough for this. I am trying to justify a move to java but its a battle convincing the business team. Please advice me on best ways to.

@fblan

This comment has been minimized.

Copy link

fblan commented Sep 16, 2019

Hi Adam,

we have a business constraint that a value should not drop below 0. The value is calculated on the fly based on a set of entries. We offer a JAX-RS endpoint to allow adding entries but if the account drops below 0. Imagine just a basic bank account where you have 50€ and you can book as long you have enough funds on your account.

Some clients started to replay their POST requests and dropped below 0€ because of race conditions,
because when the request was posted they had enough funds. How can you prevent that? Obviously, we told the clients to stop that, but we want to protect the business constraints on our side, too.

Love from Essen, DE

Hi Adam, do you think it is possible to use database to check race condition? a request looking like :

begin transaction
Query query = em.createQuery(
"UPDATE Account SET amount=amount-:removedAmount WHERE id=:id and amount>:removedAmount");
query.setParameter("id", accountid);
query.setParameter("removedAmount",105);
int updateCount = query.executeUpdate();
transaction commit
if(updateCount==1){
return 'success';
}

do you think this could work?

Thanx a lot for your podcast :)

Fred

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.