At our company we are developing a quasi standard REST service running within wildfly 10.1. Each request owns a tenant header which will be intercepted by a filter and the tenant information will be stored within a @RequestScoped
bean for later use inside the rest or service layer. So far so good.
Now we found out that some code inside a service was using a Java 8 parallel stream and failed to use the @RequestScoped
bean to lookup the current tenant.
We verified this several times. Using non parallel streams solved this issue for us.
Is this normal behaviour? We are really confused that using standard Java 8 features breaks our expected container behaviour..
Are there any other such culprits we need to care of?