mirror of https://github.com/dapr/java-sdk.git
Fix PubSubIT due to race in map. (#634)
This commit is contained in:
parent
addf6029c0
commit
680915e832
|
@ -27,7 +27,7 @@ import java.util.function.BiFunction;
|
|||
@RestController
|
||||
public class SubscriberController {
|
||||
|
||||
private final Map<String, List<CloudEvent<?>>> messagesByTopic = new HashMap<>();
|
||||
private final Map<String, List<CloudEvent<?>>> messagesByTopic = Collections.synchronizedMap(new HashMap<>());
|
||||
|
||||
@GetMapping(path = "/messages/{topic}")
|
||||
public List<CloudEvent<?>> getMessagesByTopic(@PathVariable("topic") String topic) {
|
||||
|
|
Loading…
Reference in New Issue