添加会员余额变动通知

This commit is contained in:
牛叉闪闪
2024-08-28 17:07:39 +08:00
parent 1b1fe06844
commit 9bb60335b6
3 changed files with 43 additions and 0 deletions

View File

@@ -62,4 +62,10 @@ public interface RabbitConstants {
// 库存记录交换机
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
public static final String BALANCE_PUT="balance_put";
public static final String BALANCE_QUEUE_PUT="balance_queue_put";
public static final String BALANCE_ROUTINGKEY_PUT="balance_routingkey_put";
}

View File

@@ -58,6 +58,15 @@ public class RabbitProducer implements RabbitTemplate.ConfirmCallback {
rabbitTemplate.convertAndSend(RabbitConstants.CONS_MSG_COLLECT_PUT, RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT, content, correlationId);
}
public void balance(String content){
CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
rabbitTemplate.convertAndSend(RabbitConstants.BALANCE_PUT, RabbitConstants.BALANCE_ROUTINGKEY_PUT, content, correlationId);
}
@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
logger.info(" 回调id:" + correlationData);