Improvements

This commit is contained in:
Andrii Shvaika 2020-11-11 18:02:10 +02:00
parent 3d8b2cbbbf
commit 81585f04c8
3 changed files with 16 additions and 14 deletions

View File

@ -237,7 +237,7 @@ public class DefaultTbApiUsageStateService implements TbApiUsageStateService {
@Override
public void onTenantUpdate(TenantId tenantId) {
log.info("[{}] On Tenant Update", tenantId);
log.info("[{}] On Tenant Update.", tenantId);
TenantProfile tenantProfile = tenantProfileCache.get(tenantId);
updateLock.lock();
try {
@ -251,7 +251,6 @@ public class DefaultTbApiUsageStateService implements TbApiUsageStateService {
}
private void updateTenantState(TenantApiUsageState state, TenantProfile profile) {
log.info("[{}] On Tenant Update.", state.getTenantId());
TenantProfileData oldProfileData = state.getTenantProfileData();
state.setTenantProfileId(profile.getId());
state.setTenantProfileData(profile.getProfileData());

View File

@ -164,7 +164,9 @@ public class DefaultTransportApiService implements TransportApiService {
}
private ListenableFuture<TransportApiResponseMsg> validateCredentials(TransportProtos.ValidateBasicMqttCredRequestMsg mqtt) {
DeviceCredentials credentials = deviceCredentialsService.findDeviceCredentialsByCredentialsId(mqtt.getUserName());
DeviceCredentials credentials = null;
if (mqtt.getUserName() != null) {
credentials = deviceCredentialsService.findDeviceCredentialsByCredentialsId(mqtt.getUserName());
if (credentials != null) {
if (credentials.getCredentialsType() == DeviceCredentialsType.ACCESS_TOKEN) {
return getDeviceInfo(credentials.getDeviceId(), credentials);
@ -176,10 +178,11 @@ public class DefaultTransportApiService implements TransportApiService {
}
if (credentials == null) {
credentials = checkMqttCredentials(mqtt, EncryptionUtil.getSha3Hash("|", mqtt.getClientId(), mqtt.getUserName()));
}
}
if (credentials == null) {
credentials = checkMqttCredentials(mqtt, EncryptionUtil.getSha3Hash(mqtt.getClientId()));
}
}
if (credentials != null) {
return getDeviceInfo(credentials.getDeviceId(), credentials);
} else {

View File

@ -58,7 +58,7 @@ In case of any issues you can examine service logs for errors.
For example to see ThingsBoard node logs execute the following command:
`
$ docker-compose logs -f tb-core1 tb-rule-engine1
$ docker-compose logs -f tb-core1 tb-core2 tb-rule-engine1 tb-rule-engine2 tb-mqtt-transport1 tb-mqtt-transport2
`
Or use `docker-compose ps` to see the state of all the containers.