下载了官方的短信上行的demo。可以正常运行使用,但是在线程中会一直报错。报错内容:
2020-06-30 14:56:05 [ PullMessageTask-thread-0:890407 ] - [ ERROR ] com.alicom.mns.tools.DefaultAlicomMessagePuller$PullMessageTask.run(DefaultAlicomMessagePuller.java:150) PullMessageTask_execute_error,messageType:SmsUp,queueName:Alicom-Queue-1*******-SmsUp
[Error Code]:InternalServerError, [Message]:<?xml version="1.0" ?>
<Error xmlns="http://mns.aliyuncs.com/doc/v1">
<Code>MessageNotExist</Code>
<Message>Message not exist.</Message>
<RequestId>***</RequestId>
<HostId>http://***.mns.cn-hangzhou.aliyuncs.com</HostId>
</Error>, [RequestId]: null
at com.aliyun.mns.common.http.ExceptionResultParser.parse(ExceptionResultParser.java:46)
at com.aliyun.mns.common.http.ExceptionResultParser.parse(ExceptionResultParser.java:12)
at com.aliyun.mns.common.http.HttpCallback.handleResult(HttpCallback.java:155)
at com.aliyun.mns.common.http.HttpCallback.buildResponseMessage(HttpCallback.java:128)
at com.aliyun.mns.common.http.HttpCallback.completed(HttpCallback.java:88)
at com.aliyun.mns.common.http.HttpCallback.completed(HttpCallback.java:22)
at org.apache.http.concurrent.BasicFuture.completed(BasicFuture.java:119)
at org.apache.http.impl.nio.client.DefaultClientExchangeHandlerImpl.responseCompleted(DefaultClientExchangeHandlerImpl.java:177)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.processResponse(HttpAsyncRequestExecutor.java:412)
at org.apache.http.nio.protocol.HttpAsyncRequestExecutor.inputReady(HttpAsyncRequestExecutor.java:305)
at org.apache.http.impl.nio.DefaultNHttpClientConnection.consumeInput(DefaultNHttpClientConnection.java:267)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:81)
at org.apache.http.impl.nio.client.InternalIODispatch.onInputReady(InternalIODispatch.java:39)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.inputReady(AbstractIODispatch.java:123)
at org.apache.http.impl.nio.reactor.BaseIOReactor.readable(BaseIOReactor.java:164)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:339)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:317)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:278)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:106)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:590)
at java.base/java.lang.Thread.run(Thread.java:834)
经过debug追踪。发现问题在:DefaultAlicomMessagePuller.java:150
reqeust:
GET
/queues/Alicom-Queue-1577115491384977-SmsUp/messages?numOfMessages=16
HTTP/1.1
[date: Tue, 30 Jun 2020 07:01:05 GMT,
authorization: *****,
security-token: *****,
x-mns-version: 2015-06-06,
content-type: text/xml;
charset=UTF-8,
Host: ***.mns.cn-hangzhou.aliyuncs.com,
Connection: Keep-Alive,
User-Agent: aliyun-sdk-java/1.1.8(Mac OS X/10.15.5/x86_64;11.0.3)]
response:
HTTP/1.1 404 Not Found
[Server: AliyunMQS,
Date: Tue, 30 Jun 2020 07:01:35 GMT,
Content-Type: text/xml;
charset=utf-8,
Content-Length: 271,
Connection: keep-alive,
x-mns-version: 2015-06-06,
x-mns-request-id: *****]
[Content-Length: 271,Chunked: false]
导致解析错误;这个需要如何解决呢
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。