Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiLandiak committed Feb 16, 2024
2 parents d240d24 + 2e57990 commit 7a0b005
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ private void handleWsAlarmCountCmd(WebSocketSessionRef sessionRef, AlarmCountCmd

@Override
public void sendUpdate(String sessionId, int cmdId, TelemetrySubscriptionUpdate update) {
doSendUpdate(sessionId, cmdId, update);
// We substitute the subscriptionId with cmdId for old-style subscriptions.
doSendUpdate(sessionId, cmdId, update.copyWithNewSubscriptionId(cmdId));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.thingsboard.server.service.ws.telemetry.sub;

import lombok.AllArgsConstructor;
import org.thingsboard.server.common.data.kv.TsKvEntry;
import org.thingsboard.server.service.subscription.SubscriptionErrorCode;

Expand All @@ -26,8 +27,8 @@
import java.util.TreeMap;
import java.util.stream.Collectors;

@AllArgsConstructor
public class TelemetrySubscriptionUpdate {

private final int subscriptionId;
private int errorCode;
private String errorMsg;
Expand Down Expand Up @@ -93,6 +94,10 @@ public String getErrorMsg() {
return errorMsg;
}

public TelemetrySubscriptionUpdate copyWithNewSubscriptionId(int subscriptionId){
return new TelemetrySubscriptionUpdate(subscriptionId, errorCode, errorMsg, data);
}

@Override
public String toString() {
StringBuilder result = new StringBuilder("TelemetrySubscriptionUpdate [subscriptionId=" + subscriptionId + ", errorCode=" + errorCode + ", errorMsg=" + errorMsg + ", data=");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.hibernate.exception.ConstraintViolationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.event.TransactionalEventListener;
Expand Down Expand Up @@ -106,6 +107,7 @@ public class EdgeServiceImpl extends AbstractCachedEntityService<EdgeCacheKey, E
private RelationService relationService;

@Autowired
@Lazy
private TimeseriesService timeseriesService;

@Autowired
Expand Down

0 comments on commit 7a0b005

Please sign in to comment.