This commit is contained in:
李子铭 2025-03-27 20:43:20 +08:00
parent 4cac90f2da
commit ba25cc46ac
1 changed files with 5 additions and 4 deletions

View File

@ -45,8 +45,8 @@ func Test_OrderProducer(t *testing.T) {
func Test_NotifyProducer(t *testing.T) { func Test_NotifyProducer(t *testing.T) {
m := make(map[string]*conf.EventMap) m := make(map[string]*conf.EventMap)
m["notify"] = &conf.EventMap{ m["notifyRetry"] = &conf.EventMap{
Topic: "voucher_order_notify", Topic: "voucher_order_notifyRetry",
} }
c := &conf.RocketMQ{ c := &conf.RocketMQ{
@ -64,11 +64,12 @@ func Test_NotifyProducer(t *testing.T) {
} }
ctx := context.Background() ctx := context.Background()
shardingKey := "752893584043413505_752893587050733569" shardingKey := "3"
eventMap := c.EventMap["notify"] eventMap := c.EventMap["notifyRetry"]
sendOption := []mq.SendOption{ sendOption := []mq.SendOption{
mq.WithSendShardingKeysOption(shardingKey), mq.WithSendShardingKeysOption(shardingKey),
mq.WithSendDelayLevelOption(0),
} }
if err = mqx.SendSync(ctx, eventMap.Topic, []byte("{}"), sendOption...); err != nil { if err = mqx.SendSync(ctx, eventMap.Topic, []byte("{}"), sendOption...); err != nil {