GoodsBuyAnalystMessageListener implements MessageListener { @SuppressWarnings("unchecked") @Override public void onMessage(Message message) { TextMessage textMessage = (TextMessage) message; try { String result = textMessage.getText(); logger.info("result:"+result); UserGoodsOrderDetailVo vo = JSON.parseObject(result, UserGoodsOrderDetailVo.class); ((PriorityBlockingQueue<UserGoodsOrderDetailVo>) CollectorConstant.DATA_MAP_BLOCKINGQUEUE.get(usergoodsorder_key)).put(vo); } catch (Exception e) { logger.error(e.getMessage(), e); } }  @SuppressWarnings("unchecked") @Override void onMessage(Message message);  }
@Test public void testOnMessage() { logger.info("start"); try { Thread.sleep(1000*60*5); } catch (InterruptedException e) { e.printStackTrace(); } }