简体   繁体   中英

Spring cloud AWS: send to SQS URL rather than to Queue Name

I'm trying to use spring-cloud-aws to send messages to Amazon SQS.

Is there any way to, send messages to a URL, instead of to a queue name?

Ie, instead of:

queueMessagingTemplate.convertAndSend(QUEUE_NAME, message);

I'd like to do

queueMessagingTemplate.convertAndSend(QUEUE_URL, message);

You can do this in the AmazonSQSClient by doing

sqsClient.sendMessage(QUEUE_URL, message)

Likewise for the @MessageMapping annotation, I'd like to do

@MessageMapping(QUEUE_URL)

instead of

@MessageMapping(QUEUE_NAME)

Is this possible?

Yes! entirely possible.

example:

@SqsListener (MY_QUEUE_NAME)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM