Тайм-аут доступа шлюза возврата 504

Перебрать проблему

[Феномен] Тайм-аут шлюза доступа
{
    "timestamp": "2019-06-29 11:45:13",
    "path": "/admin/user/info",
    "status": 504,
    "error": "Gateway Timeout",
    "message": "Response took longer than configured timeout"
}
[Способ] Согласно просмотреть расположение ошибки исходного кода,

AbstractCommand->

HystrixObservableTimeoutOperator->

Окончательный Справочник TL = HystrixTimer.getInstance () addTimerListener (слушатель).

  1. Мелькают класс прослушивания
public Reference<TimerListener> addTimerListener(final TimerListener listener) {
        startThreadIfNeeded();
        // add the listener

        Runnable r = new Runnable() {

            @Override
            public void run() {
                try {
                    listener.tick();
                } catch (Exception e) {
                    logger.error("Failed while ticking TimerListener", e);
                }
            }
        };

        ScheduledFuture<?> f = executor.get().getThreadPool().scheduleAtFixedRate(r, listener.getIntervalTimeInMilliseconds(), listener.getIntervalTimeInMilliseconds(), TimeUnit.MILLISECONDS);
        return new TimerReference(listener, f);
    }

2. Найдите ключевые моменты

    listener.getIntervalTimeInMilliseconds()

3. Тогда посмотрите на реализации Листер

        @Override
        public int getIntervalTimeInMilliseconds() {
            return properties.timerDelayInMilliseconds().get();
        }

4. Найдите свойства основных классов

HystrixCollapserProperties

5. наконец, нашли ключевые атрибуты

timerDelayInMilliseconds

 protected HystrixCollapserProperties(HystrixCollapserKey key, Setter builder, String propertyPrefix) {
        this.maxRequestsInBatch = getProperty(propertyPrefix, key, "maxRequestsInBatch", builder.getMaxRequestsInBatch(), default_maxRequestsInBatch);
        this.timerDelayInMilliseconds = getProperty(propertyPrefix, key, "timerDelayInMilliseconds", builder.getTimerDelayInMilliseconds(), default_timerDelayInMilliseconds);
        this.requestCacheEnabled = getProperty(propertyPrefix, key, "requestCache.enabled", builder.getRequestCacheEnabled(), default_requestCacheEnabled);
        this.metricsRollingStatisticalWindowInMilliseconds = getProperty(propertyPrefix, key, "metrics.rollingStats.timeInMilliseconds", builder.getMetricsRollingStatisticalWindowInMilliseconds(), default_metricsRollingStatisticalWindow);
        this.metricsRollingStatisticalWindowBuckets = getProperty(propertyPrefix, key, "metrics.rollingStats.numBuckets", builder.getMetricsRollingStatisticalWindowBuckets(), default_metricsRollingStatisticalWindowBuckets);
        this.metricsRollingPercentileEnabled = getProperty(propertyPrefix, key, "metrics.rollingPercentile.enabled", builder.getMetricsRollingPercentileEnabled(), default_metricsRollingPercentileEnabled);
        this.metricsRollingPercentileWindowInMilliseconds = getProperty(propertyPrefix, key, "metrics.rollingPercentile.timeInMilliseconds", builder.getMetricsRollingPercentileWindowInMilliseconds(), default_metricsRollingPercentileWindow);
        this.metricsRollingPercentileWindowBuckets = getProperty(propertyPrefix, key, "metrics.rollingPercentile.numBuckets", builder.getMetricsRollingPercentileWindowBuckets(), default_metricsRollingPercentileWindowBuckets);
        this.metricsRollingPercentileBucketSize = getProperty(propertyPrefix, key, "metrics.rollingPercentile.bucketSize", builder.getMetricsRollingPercentileBucketSize(), default_metricsRollingPercentileBucketSize);
    }

управления атрибут Тайм-аут шлюза через ОРЗ Hystrix

Неправильное направление, и быстро изменить направление

https://www.cnblogs.com/520playboy/p/8074347.html

резюме

Шлюз был ищет собственности, и пытался в течение длительного времени, не нашел в Интернете, чтобы найти все виды, в конечном итоге, посмотрев на исходный код, найденный в неправильном направлении, и направление регулировки, лото.

рекомендация

отwww.cnblogs.com/mengjianzhou/p/11106221.html