多行情消费者(多线程)两次并发事故
1
突然改成多线程行情消费者,导致并发,重复成交
还有一个方案:成交后投递到mq,由mq消费者单点消费排重后处理成交
/Users/joyce/work/jds/trade/simulate-trade/tradeEngine/src/main/java/com/jds/engine/listener/StockQuoteEventConsumer.java
2
此例子最大的问题在于,原先寄期望于子线程1s内解决的不严谨,导致重复推送价格预警
/Users/joyce/work/jds/warn/stock/priceWarn/src/main/java/com/jds/pricewarn/event/StockPriceConsumer.java
/Users/joyce/work/jds/warn/stock/priceWarn/src/main/java/com/jds/pricewarn/task/ExecutorTask.java