|
|
|
@ -1,12 +1,12 @@ |
|
|
|
/** |
|
|
|
* Copyright © 2016-2018 The Thingsboard Authors |
|
|
|
* |
|
|
|
* <p> |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* You may obtain a copy of the License at |
|
|
|
* |
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* |
|
|
|
* <p> |
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* <p> |
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
@ -37,6 +37,7 @@ import org.thingsboard.server.common.data.kv.ReadTsKvQuery; |
|
|
|
import org.thingsboard.server.common.data.kv.TsKvEntry; |
|
|
|
import org.thingsboard.server.dao.attributes.AttributesService; |
|
|
|
import org.thingsboard.server.dao.timeseries.TimeseriesService; |
|
|
|
import org.thingsboard.server.dao.util.TenantRateLimitException; |
|
|
|
import org.thingsboard.server.service.security.AccessValidator; |
|
|
|
import org.thingsboard.server.service.security.ValidationCallback; |
|
|
|
import org.thingsboard.server.service.security.ValidationResult; |
|
|
|
@ -403,7 +404,11 @@ public class DefaultTelemetryWebSocketService implements TelemetryWebSocketServi |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailure(Throwable e) { |
|
|
|
log.error(FAILED_TO_FETCH_DATA, e); |
|
|
|
if (e instanceof TenantRateLimitException || e.getCause() instanceof TenantRateLimitException) { |
|
|
|
log.trace("[{}] Tenant rate limit detected for subscription: [{}]:{}", sessionRef.getSecurityCtx().getTenantId(), entityId, cmd); |
|
|
|
} else { |
|
|
|
log.info(FAILED_TO_FETCH_DATA, e); |
|
|
|
} |
|
|
|
SubscriptionUpdate update = new SubscriptionUpdate(cmd.getCmdId(), SubscriptionErrorCode.INTERNAL_ERROR, |
|
|
|
FAILED_TO_FETCH_DATA); |
|
|
|
sendWsMsg(sessionRef, update); |
|
|
|
|