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

Arkaitz Jimenez commented on HTTPASYNC-144:
-------------------------------------------

I understand both the UserTokenHandler and the Context can be used for that 
same thing right?

Otherwise why use the userTokenHandler to tag the connections at release time 
but not using it when extracting the token to tag the request?

I definitely interpret the [documentation 
|https://hc.apache.org/httpcomponents-client-ga/tutorial/html/advanced.html]  
like it. Although the doc is for the sync client, do the clients diverge in 
there?

 

> AbstractClientExchangeHandler does not make use of UserTokenHandler
> -------------------------------------------------------------------
>
>                 Key: HTTPASYNC-144
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-144
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>            Reporter: Arkaitz Jimenez
>            Priority: Major
>
> While writing an async client that does make use of SSL, user token handling 
> is essential for proper use of pooling.
> I found 2 ways of passing the user token to the client:
>  # Create a HttpClientContext and ctx.setUserToken(fixedString); and pass 
> that context to execute(request, ctx);
>  # Create the AsyncHttpClient via HttpAsyncClients.custom() and setting 
> setUserTokenHandler((ctx)->fixedString);
> The first one works no problem.
> The second one fails because AbstractClientExchangeHandler queries the 
> context userToken directly without using the UserTokenHandler in 
> AbstractClientExchangeHandler::requestConnection.
> That means the userToken for the request will always be null and never match 
> the one that is assigned to an open connection.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to