Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

SQS change message visibility #92

Open
unniksk opened this issue Aug 18, 2015 · 7 comments
Open

SQS change message visibility #92

unniksk opened this issue Aug 18, 2015 · 7 comments
Assignees
Labels
component: sqs SQS integration related issue type: feature A new feature
Milestone

Comments

@unniksk
Copy link

unniksk commented Aug 18, 2015

Is there any way to change message visibility of SQS messages.

@MessageMapping("SQS_URL)
public void queueListener(String message,@Header("ReceiptHandle") String receiptHandle) throws Exception {
   amazonSqs.changeMessageVisibility(new ChangeMessageVisibilityRequest(sqsURL, amazonMessage.getReceiptHandle(),120));
}

This might change the visibility but the message gets deleted from the queue.

@alainsahli
Copy link
Contributor

Hi @unniksk You can set the visibility using XML or Java Config:

@Bean
public SimpleMessageListenerContainerFactory simpleMessageListenerContainerFactory() {
    SimpleMessageListenerContainerFactory factory = new SimpleMessageListenerContainerFactory();
    factory.setVisibilityTimeout(20);

    return factory;
}
<aws-messaging:annotation-driven-queue-listener auto-startup="false" visibility-timeout="20" />

@alainsahli alainsahli added the type: question A question label Aug 18, 2015
@artembilan
Copy link

See fully similar SO question on the matter http://stackoverflow.com/questions/38355551/aws-integration-spring-extend-visibility-timeout.

I'm reopening an issue since the provided solution doesn't fix the real premise.

@artembilan artembilan reopened this Jul 14, 2016
@artembilan artembilan added type: feature A new feature and removed type: question A question labels Jul 14, 2016
@aemruli aemruli added this to the 1.1.1 milestone Jul 15, 2016
@alainsahli alainsahli reopened this Jul 17, 2016
@ryanjbaxter ryanjbaxter modified the milestones: 1.1.1, 1.1.2 Aug 23, 2016
@uweschaefer
Copy link

Same Problem here. Unless you can "guess" a good max value for Visibility Timeout, it is hard to use SQS, because the original consumer of a message could still be working without anyone knowing, when an in-Flight Messgae is redelivered.

It'd be nice, if SimpleMessageListenerContainer.MessageExecutor.Run() would prolong the timeout actively, as long as executeMessage() does not return or fail.

@uweschaefer
Copy link

would it be reasonable to work on that and provide a PR?

@alainsahli alainsahli modified the milestones: 1.1.4, 1.1.2 Oct 15, 2016
@uweschaefer
Copy link

apparently not. never mind.

@aemruli
Copy link
Contributor

aemruli commented Feb 28, 2017

@uweschaefer any PR is welcome if we can integrate. Nevertheless I move this issue to 1.2.x line

@aemruli aemruli modified the milestones: 1.2.0, 1.1.4 Feb 28, 2017
@BernhardBln
Copy link

Would be nice if a maximum time and even the increment sizes could be defined, though (like, default visibility timeout which is a bit shorter, and automatic prolonging with a given time, up to the given maximum)

@spencergibb spencergibb modified the milestones: 1.2.0, Backlog Apr 6, 2017
@maciejwalkowiak maciejwalkowiak added the component: sqs SQS integration related issue label May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
component: sqs SQS integration related issue type: feature A new feature
Development

No branches or pull requests

9 participants