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*

Reply via email to