jclouds-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ignasi Barrera <n...@apache.org>
Subject Re: Fwd: Need Help to resolve Custom Retry Handler Issue
Date Tue, 13 Sep 2016 18:49:37 GMT

It is not easy to override bindings in Guice modules. The common way to do
that is by using the "Modules.override" helper but in this case, since the
module that defines the binding is a default module in the api metadata and
it is jclouds who instantiates it, you won't be able to use that.

What you can do is a linked binding from the default implementation to your
custom one. Something like:


(If I'm not wrong this is the handler that is already registered)
Your impl will have to extend the jclouds default one, apply your logic
and/or fallback to the superclass.



El 13 sept. 2016 4:37 p. m., "Dileep Dixith" <dil022dixith@gmail.com>


> Hi All,
> For our project we need to write a custom retry handler for jclouds
during PUT Operation.. We want to override default
> I want to know whether it is possible to write custom retry handler for
PUT operation or not.
> Our Code snippet goes as below.
> modules = ImmutableSet.<Module> builder()
> .addAll(modules)
> .add(new AbstractModule()
> {
> @Override
> public void configure()
> {
> bind(HttpRetryHandler.class).annotatedWith(Redirection.class).to(<our
custom class>.class);
> }
> })
> .build();
> <our custom class> implements HttpRetryHandler,IOExceptionRetryHandler
similar to
> But even after failure, our custom retry handler never called, instead
jclouds still makes call to   BackoffLimitedRetryHandler
> 2016-09-12@07:38:51.812 E            [mcstore-01          ]
koffLimitedRetryHandler:logError - Cannot retry after server error, command
has exceeded retry limit 5:
[method=org.jclouds.openstack.swift.SwiftKeystoneClient.public abstract

> Notes:
> a. If I change
got error stating
> HttpRetryHandler already registered with ClientError and can not be
binded again at
> b. Even tried  bind(HttpRetryHandler.class).to(ICStoreRetryHandler.class)
and still custom handler not executed.
> Need your help to resolve this issue.

View raw message