[
https://issues.apache.org/jira/browse/CXF-7246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15863205#comment-15863205
]
Dhawal commented on CXF-7246:
-----------------------------
Hi Sergey,
Thanks for the input.
I dont think so this will help my case. My Code flow spawns new threads after
controller endpoint for parallel execution and each newly created thread
created looks up for that Message Object. I think this case is not even working
in Apache CXF 3.x, because there is no way the Message object is going to be
passed to child threads because its defined as ThreadLocal in
PhasInterceptorChain.
Looks like this needs to be built up in Apache CXF, there are cases where we
might want to have Message Object available to child threads(new threads
spawned after endpoint api, anywhere in the application). This makes strong
pain point that if we store something in Message Object then we cant exploit
parallelism.
Please let me know if you need anymore details.
Thanks,
Dhawal Patel
> PhaseInterceptorChain's Message is not passed to child threads.
> ----------------------------------------------------------------
>
> Key: CXF-7246
> URL: https://issues.apache.org/jira/browse/CXF-7246
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.6.14
> Reporter: Dhawal
>
> Hello,
> We put few information(usually request header information) in Message through
> RequestHandler by doing
> PhaseInterceptorChain.getCurrentMessage.getExchange.put("","");
> But when we create a new Threads from the thread which brings in request to
> the controller, those objects which are put in the Exchange are not available
> to new threads. The PhaseInterceptorChain has Message object which is
> ThreadLocal so the objects are not available to subsequent threads which are
> created, so exploiting parallelism is quite painful once we store something
> in Exchange object.
> As a suggestion can we have Message object as optional between ThreadLocal
> and InheritableThreadLocal and via a configuration we can set that do we need
> to make available Message object to child threads.
> Thanks,
> Dhawal Patel
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)