Is there clean way to pass context data to @Asynchronous ejb call?
问题 In wildfly I execute stateless ejb method asynchronously (it is mapped with @Asynchronous annotation). In the calling method I have some context information in thread local. What is the best way to pass this data to async method? I don't want to add additional parameter to async method signature. 回答1: Essentially you have only 2 options: Passing value as a parameter Storing that value in some global place. Like static variable. The first option is much cleaner and easier. Don't use the second