AWS消息配置:注释驱动队列侦听器

时间:2019-02-12 09:09:56

标签: spring-cloud amazon-sqs

我已经如图所示进行配置,但得到 cvc-complex-type.2.4.c:匹配的通配符很严格,但是找不到元素'aws-messaging:annotation-driven-queue-的声明。  听众”。

context.xml    

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
xmlns:aws-messaging="http://www.springframework.org/schema/cloud/aws/messaging"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/cloud/aws/context
    http://www.springframework.org/schema/cloud/aws/context/spring-cloud-aws-context.xsd
    http://www.springframework.org/schema/cloud/aws/messaging        
http://www.springframework.org/schema/cloud/aws/messaging/spring-cloud-aws-messaging.xsd">

<aws-messaging:annotation-driven-queue-listener/>

</beans>

In the pom I have 
        <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-aws</artifactId>
        <version>2.1.0.RELEASE</version>
    </dependency>

我已经如图所示进行配置,但得到 cvc-complex-type.2.4.c:匹配的通配符很严格,但是找不到元素'aws-messaging:annotation-driven-queue-的声明。  听众”。

1 个答案:

答案 0 :(得分:0)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aws-context="http://www.springframework.org/schema/cloud/aws/context"
xmlns:aws-messaging="http://www.springframework.org/schema/cloud/aws/messaging"
xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation=
    "http://www.springframework.org/schema/beans 
ht tp://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/cloud/aws/context  
http://www.springframework.org/schema/cloud/spring-cloud-aws-context.xsd
    http://www.springframework.org/schema/cloud/aws/messaging 
http://www.springframework.org/schema/cloud/spring-cloud-aws-messaging.xsd">