feat: 二阶段
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package demo.mq;
|
||||
|
||||
public final class CapitalMqConstants {
|
||||
public static final String TOPIC = "capital-topic";
|
||||
public static final String TAG_WALLET_DEDUCT = "WALLET_DEDUCT";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package demo.mq;
|
||||
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
|
||||
public class WalletDeductProducer {
|
||||
private RocketMQTemplate rocketMQTemplate;
|
||||
|
||||
public void send(WalletDeductReq req) {
|
||||
rocketMQTemplate.syncSend(CapitalMqConstants.TOPIC + ":" + CapitalMqConstants.TAG_WALLET_DEDUCT, req);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package demo.mq;
|
||||
|
||||
public class WalletDeductReq {
|
||||
private String walletId;
|
||||
private Long amount;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package demo.mq;
|
||||
|
||||
public class WalletDeductReq {
|
||||
private String walletId;
|
||||
private Long amount;
|
||||
private String remark;
|
||||
}
|
||||
Reference in New Issue
Block a user