package com.hpe.caf.autoscale.scaler.marathon;


import com.hpe.caf.api.ConfigurationException;
import com.hpe.caf.api.ConfigurationSource;
import com.hpe.caf.api.autoscale.ScalerException;
import com.hpe.caf.api.autoscale.ServiceScaler;
import com.hpe.caf.api.autoscale.ServiceScalerProvider;
import com.hpe.caf.autoscale.MarathonAutoscaleConfiguration;
import mesosphere.marathon.client.MarathonClient;

import java.net.MalformedURLException;
import java.net.URL;


public class MarathonServiceScalerProvider implements ServiceScalerProvider
{
    @Override
    public ServiceScaler getServiceScaler(final ConfigurationSource configurationSource)
            throws ScalerException
    {
        try {
            MarathonAutoscaleConfiguration config = configurationSource.getConfiguration(MarathonAutoscaleConfiguration.class);
            URL url = new URL(config.getEndpoint());
            return new MarathonServiceScaler(MarathonClient.getInstance(url.toString()), config.getMaximumInstances(), url);
        } catch (ConfigurationException | MalformedURLException e) {
            throw new ScalerException("Failed to create service scaler", e);
        }
    }
}

@@ -344,24 +344,110 @@
 figuration;%0A
+import feign.Feign;%0Aimport feign.Request;%0Aimport mesosphere.marathon.client.Marathon;%0A
 import mesos
@@ -484,16 +484,16 @@
 Client;%0A
-
 %0Aimport 
@@ -625,16 +625,74 @@
 vider%0A%7B%0A
+    private static final int MARATHON_TIMEOUT = 10_000;%0A%0A%0A
     @Ove
@@ -1038,41 +1038,146 @@
     
-return new MarathonServiceScaler(
+Feign.Builder builder = Feign.builder().options(new Request.Options(MARATHON_TIMEOUT, MARATHON_TIMEOUT));%0A            Marathon marathon = 
 Mara
@@ -1199,16 +1199,25 @@
 nstance(
+builder, 
 url.toSt
@@ -1223,16 +1223,71 @@
 tring())
+;%0A            return new MarathonServiceScaler(marathon
 , config

Set HTTP timeout to 10 seconds