redis消息队列订阅发布

MessageQueueUtil.publish(MsgTopic.CUSTOMER_INFO_UPDATE,
JSON.toJSONString(reqCustomerInfo));//这个表示消息的发布工作
/**
* 监听客户信息同步消息
* @param message
* @param channel
*/
@IotasSubscribe(topic=MsgTopic.CUSTOMER_INFO_UPDATE)
public void processCustomerInfoUpdate(String message, String channel) {

CustomerSyncInfoBean customerSyncInfo= JSON.parseObject(message, CustomerSyncInfoBean.class);
logger.info("收到频道" + channel + " 的消息,  = " + customerSyncInfo.toString());
InitService initService = (InitService)ApplicationUtil.getBean("initService");
// CustomerSyncRsp rsp = new CustomerSyncRsp();
initService.syncCustomerInfo(customerSyncInfo);
}

你可能感兴趣的:(javaweb,javaee企业级开发,javaee企业开发,redis,消息队列,订阅和发布)