Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jersey-dev] Help needed in jersey timeout

Hi Jan

Thanks for the reply.

 I have below requirements.

I have OkHttp client which is being used for sending request and has READ_TIMEOUT_PROPERTY.

 protected void populateClientConfig(ClientConfig aInClientConfig,
            Map<String, Object> aInProperties) throws Exception
    {
        aInClientConfig.property(CONNECT_TIMEOUT_PROPERTY,
                aInProperties.get(CONNECT_TIMEOUT_PROPERTY));
        aInClientConfig.property(WRITE_TIMEOUT_PROPERTY,
                aInProperties.get(WRITE_TIMEOUT_PROPERTY));
        aInClientConfig.property(READ_TIMEOUT_PROPERTY,
                aInProperties.get(READ_TIMEOUT_PROPERTY));
        aInClientConfig.property(PROXY_HOST_PROPERTY,
                aInProperties.get(PROXY_HOST_PROPERTY));
        aInClientConfig.property(PROXY_PORT_PROPERTY,
                aInProperties.get(PROXY_PORT_PROPERTY));
        aInClientConfig.property(PROXY_TYPE_PROPERTY,
                aInProperties.get(PROXY_TYPE_PROPERTY));
        aInClientConfig.property(OK_HTTP_PROTOCOL_LIST,
                aInProperties.get(OK_HTTP_PROTOCOL_LIST));
        aInClientConfig.connectorProvider(new OkHttpConnectorProvider());
    }

In configuration file READ_TIMEOUT_PROPERTY has been configured to 60 sec.
So the client gets populated using the above mentioned properties and common to all application using this client.

My issue is :

This logic is in our product . There are 2 applications using this common client. One application wants 60 sec as READ_TIMEOOUT and another needs 5 sec .
So I want to know is there any way through which this property can be set in the request so as other application's read time out does not get changed.

Though i have one solution i.e creating a separate client all together having different properties but I want to know is there any way through which within jersey it can be achieved.

Hope you would have understood my query.

Regards
Santosh

From: jersey-dev-bounces@xxxxxxxxxxx <jersey-dev-bounces@xxxxxxxxxxx> on behalf of Jan Supol <jan.supol@xxxxxxxxxx>
Sent: Friday, October 4, 2019 9:18 PM
To: jersey-dev@xxxxxxxxxxx <jersey-dev@xxxxxxxxxxx>
Subject: Re: [jersey-dev] Help needed in jersey timeout
 
Hi Santosh,

I am not sure what configuration you want to set. If you want to set
something like

|client.property(ClientProperties.CONNECT_TIMEOUT,1000); |

it does not configure every Client, just the one instance. I assume you
may be use some feature to configure every client or something?

For me, a little piece of code would help me to better understand the
issue.


Feel free to file a bug on Jersey issue tracker [1] if you think there
is a use case Jersey cannot handle well.


Thanks,

Jan

[1] https://github.com/eclipse-ee4j/jersey/issues


On 30.09.2019 11:06, santosh kumar wrote:
> Hi Jersey Developers,
>
> Greetings of the day !
>
> I am a java developer using jersey for http communication.
>
> I am facing one issue in which i need you guys suggestion.
>
> I want request specific jersey timeout configuration. I know there is
> one way through which we can override the default timeout property but
> the issue is jersey is being used between different applications in
> our product.
>
> I want that my application's should use the specific timeout other
> than the other applications.
>
> If I change the default configuration of timeout then all
> application's timeout would be changed which I don't want.
>
> Can you guys help me finding the solution of this issue.
>
> Regards
> Santosh
>
>
> _______________________________________________
> jersey-dev mailing list
> jersey-dev@xxxxxxxxxxx
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jersey-dev
_______________________________________________
jersey-dev mailing list
jersey-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/jersey-dev

Back to the top