jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zack Shoylev <zack.shoy...@RACKSPACE.COM>
Subject Re: Query regarding UNBLOCK swift API's with configurable timeout
Date Mon, 04 Jan 2016 12:34:12 GMT
Try to experiment with the connection variables, documented here:


https://jclouds.apache.org/reference/configuration/?

________________________________
From: Abhijeet Banerjee <abhijeet.feb@gmail.com>
Sent: Monday, January 4, 2016 6:16 AM
To: user@jclouds.apache.org
Subject: Query regarding UNBLOCK swift API's with configurable timeout

Hello,

I am facing a problem where my application[using JCloud API's] try to DELETE an object from
swift.
Now, by any means if swift server is not approachable, DELETE API get blocked for certain
amount of time (i.e 60 sec)

But, my Container [ Cloud Foundry], where my application is deployed.The maximum waiting time
for any HTTP request's response is configured as 30Sec.

Due the reason,Client used to get 504 (Bad Gateway Request) Response, whereas my code requirement
is to send 200 Response (As we don't bother if Object was deleted or not, I need to send 200
OK response towards client)

Now, My Question, Is there any way, through which i can configure my DELETE should try till
(10-20 Second) max after that it return failure to my application.

CODE Snippet:
public class MyClassImpl{
EnvVariables envVariables = EnvVariables.getInstance();

private SwiftApi getContext(){
       return ContextBuilder.newBuilder(
envVariables.getprovider()).
endpoint(envVariables.getendUrl()).
credentials(envVariables.getidentity(), envVariables.getcredential()).
buildApi(SwiftApi.class);

    }
public void deleteObject(final String objectName) {
    SwiftApi swiftApi = getContext();

    // Saving the "region" or "Container" where object need to save.
    ObjectApi objectApi = swiftApi.getObjectApi(envVariables.getregion(), "MyContainer");
     objectApi.delete(objectName + ".wav");
}


--
Thanks\
Abhijeet Banerjee
+919910512611
[https://static.licdn.com/scds/common/u/img/webpromo/btn_profile_bluetxt_80x15.png]




Mime
View raw message