Skip to content

aliyun-sms-spring-boot-starter 模块实现 SmsReportMessageListener 类之后启动报错,无法拉取回执消息。 #79

Description

@gyl-coding

报错信息如下
a、一启动就会报如下错误,切换了mns节点也无济于事;
b、发短信正常;
image

1. pom



com.alibaba.cloud
aliyun-spring-boot-dependencies
1.0.0
pom
import


com.alibaba.cloud aliyun-sms-spring-boot-starter

2. yml
alibaba:
cloud:
access-key: LsQ
secret-key: 2
0B
sms:
report-queue-name: Alicom-Queue-1410-SmsReport
up-queue-name: Alicom-Queue-14
10-SmsUp

3. 监听类
/**

  • @author 如果需要监听短信是否被对方成功接收,只需实现这个接口并初始化一个 Spring Bean 即可。
    */
    @slf4j
    @component
    public class SmsReportListener implements com.alibaba.cloud.spring.boot.sms.SmsReportMessageListener {
    private List smsReportMessageSet = new LinkedList<>();
    @OverRide
    public boolean dealMessage(Message message) {
    smsReportMessageSet.add(message);
    log.error(this.getClass().getName() + "; " + message.toString());
    if (message != null) {
    return true;
    }
    return false;
    }
    public List getSmsReportMessageSet() {
    return smsReportMessageSet;
    }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions