2

I have setup locastack in my local pc. I am able to create, send and receive in the queue using command line.

How am trying to connect SpringBoot application with the localstcak queue.

I am not finding any tutorial which will guide me how we can read data from localstack queue using spring cloud.

I have a class which looks like this

@Component
@Profile("aws")
public class EventListener {

    private static final Logger LOGGER = LoggerFactory.getLogger(VisitsQueue.class);

    @Value("${sqs.queuename}")
    private String queueName;

    private ObjectMapper mapper = new ObjectMapper();

    @RuntimeUse
    @SqsListener("${sqs.queuename}")
    public void receiveMessage(String message, @Header(value = "SenderId", required = false) String senderId,
            @Headers Map<String, Object> allHeaders) {
        LOGGER.info("Received message with content {}", message);
    }
}
spencergibb
  • 24,471
  • 6
  • 69
  • 75
Suman-PHP4U
  • 1,185
  • 11
  • 13

0 Answers0