You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2020/11/04 19:30:00 UTC

[jira] [Commented] (CXF-8348) Question about sharing thread-safe data between interceptor

    [ https://issues.apache.org/jira/browse/CXF-8348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17226358#comment-17226358 ] 

Freeman Yue Fang commented on CXF-8348:
---------------------------------------

Hi [~junhuhdev],

IMO storing in the cxf exchange object is the most straightforward way to do it.
The interceptor itself should be stateless, if you have any stateful data which life is just for a invocation, then the cxf exchange is the place to store.

Best Regards
Freeman

> Question about sharing thread-safe data between interceptor
> -----------------------------------------------------------
>
>                 Key: CXF-8348
>                 URL: https://issues.apache.org/jira/browse/CXF-8348
>             Project: CXF
>          Issue Type: Bug
>            Reporter: Jun
>            Priority: Major
>
> Hello,
> I have a scenario where I need to store a session token that can only be used once for next subsequent soap request. 
> I am having a bit of trouble implementing this. 
> My initial approach was to create an inbound- and outbound interceptor.
> In the inbound interceptor I store the session token if available so that the outbound interceptor can use it. 
> But I'm not sure how to pass the data between interceptors and also guarantee thread-safety.
> (1) Should I store in the exchange object? 
> (2) Should I implement some custom FIFO queue to handle this?
> (3) Should I use MDC context to store it? 
> Any feedback would be greatly appreciated.
> // Jun



--
This message was sent by Atlassian Jira
(v8.3.4#803005)