Skip to content

Commit

Permalink
openvidu-server: fix circular dependency with @PostConstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloFuente committed Sep 29, 2023
1 parent ec2396d commit ac64aeb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ public RpcHandler rpcHandler() {

@Bean
@ConditionalOnMissingBean
@DependsOn("rpcHandler")
public RpcNotificationService notificationService(RpcHandler rpcHandler) {
return new RpcNotificationService(rpcHandler);
public RpcNotificationService notificationService() {
return new RpcNotificationService();
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpSession;

import org.apache.commons.lang3.RandomStringUtils;
Expand Down Expand Up @@ -83,6 +84,11 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {

private ConcurrentMap<String, Boolean> webSocketEOFTransportError = new ConcurrentHashMap<>();

@PostConstruct
public void init() {
notificationService.setRpcHandler(this);
}

@Override
public void handleRequest(Transaction transaction, Request<JsonObject> request) throws Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class RpcNotificationService {

private RpcHandler rpcHandler;

public RpcNotificationService(RpcHandler rpcHandler) {
public void setRpcHandler(RpcHandler rpcHandler) {
this.rpcHandler = rpcHandler;
}

Expand Down

0 comments on commit ac64aeb

Please sign in to comment.