Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ public Boolean get() {

if (config.isWebSocketServiceEnabled()) {
// Use local broker address to avoid different IP address when using a VIP for service discovery
this.webSocketService = new WebSocketService(
new ClusterData(webServiceAddress, webServiceAddressTls, brokerServiceUrl, brokerServiceUrlTls),
config);
this.webSocketService = new WebSocketService(null, config);
this.webSocketService.start();

final WebSocketServlet producerWebSocketServlet = new WebSocketProducerServlet(webSocketService);
Expand Down Expand Up @@ -466,6 +464,12 @@ public Boolean get() {
this.brokerServiceUrl = brokerUrl(config);
this.brokerServiceUrlTls = brokerUrlTls(config);

if (null != this.webSocketService) {
ClusterData clusterData =
new ClusterData(webServiceAddress, webServiceAddressTls, brokerServiceUrl, brokerServiceUrlTls);
this.webSocketService.setLocalCluster(clusterData);
}

// needs load management service
this.startNamespaceService();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import javax.servlet.ServletException;
import javax.websocket.DeploymentException;

import lombok.Setter;
import org.apache.bookkeeper.common.util.OrderedScheduler;
import org.apache.pulsar.broker.PulsarServerException;
import org.apache.pulsar.broker.ServiceConfiguration;
Expand Down Expand Up @@ -77,6 +78,7 @@ public class WebSocketService implements Closeable {
private ServiceConfiguration config;
private ConfigurationCacheService configurationCacheService;

@Setter
private ClusterData localCluster;
private final ConcurrentOpenHashMap<String, ConcurrentOpenHashSet<ProducerHandler>> topicProducerMap;
private final ConcurrentOpenHashMap<String, ConcurrentOpenHashSet<ConsumerHandler>> topicConsumerMap;
Expand Down