Hamza LAHLOU
Hamza LAHLOU

Reputation: 99

Cannot resolve symbol 'QueueMessagingTemplate'

I'm currently working on library using spring boot 2.7. In the process of migrating to spring boot 3.1.4 I got an error on a class where:

import org.springframework.cloud.aws.messaging.core.QueueMessagingTemplate;

not found. Eventhough I have the jar present in the classpath but still cannot find the class.

I already cleared the cache, refreshed the gradle dependencies

the gradle file contain the following dependencies:

implementation(platform("org.springframework.cloud:spring-cloud-aws-dependencies:${property('spring-cloud-aws-dependencies.version')}"))

spring-cloud-aws-dependencies.version = 2.2.6.RELEASE

Upvotes: 3

Views: 2212

Answers (2)

epox
epox

Reputation: 10890

Since Spring Boot 3.0

import io.awspring.cloud.messaging.core.QueueMessagingTemplate;

import io.awspring.cloud.core.env.ResourceIdResolver;
import io.awspring.cloud.messaging.config.QueueMessageHandlerFactory;

Upvotes: 0

mekoda
mekoda

Reputation: 333

In order to use the SDK with Spring Boot 3, you should change to new dependencies and migrate to the new messaging approach:

 <!-- For SQS -->
 <dependency>
        <groupId>io.awspring.cloud</groupId>
        <artifactId>spring-cloud-aws-starter-sqs</artifactId>
 </dependency>

 <!-- For SNS -->
 <dependency>
        <groupId>io.awspring.cloud</groupId>
        <artifactId>spring-cloud-aws-starter-sns</artifactId>
 </dependency>

Note that using the spring-cloud-aws-messaging dependency won't solve the issue, as it's not designed for Spring Boot 3, and you'll still probably miss some classes during runtime. I assume that you are using QueueMessagingTemplate to send to SQS; if that's the case, you can give a try to SqsTemplate to achieve the same.

Upvotes: 1

Related Questions