-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to acknowledge message in custom error handler #120
Comments
I haven't used the JMS interface so hard to say. Maybe you could create a small project which replicates the error? |
Im currently having a look into this because I am experiencing some problems like this. |
@adamw sorry i missed the comment.... will try to build something and share.... |
hi, It turns out there is something going on but Im not sure exactly what it is.
Output from the sdk ... Since there is very little in the form of introspection for the queues I dont really know if they have or have not been removed from the queue. It uses a batch delete with the last receipt. None the less I've got a workaround for our tests that we are using although I not sure its this exact problem. I investigated it while trying to find a fix and it seems there is something not quite right here. I think we could make a test that sends a large amount of messages and links into the aws jms to receive and acknowledges them as quickly as possible then this warning should appear. It may even be an incorrect log from the SDK.... although you would hope not. |
Hello.
I have created a custom error handler to handle application exceptions and do logging or retrying based on the Exception type.
Below is the sample code what m trying to do:
//QueueMessageListener.java
`public void onMessage(Message message) {
try {
TextMessage textMessage = (TextMessage) message;
}`
//`
public class CustomErrorHandler implements ErrorHandler {
}
}`
//Configuration
DefaultMessageListenerContainer dmlc = new DefaultMessageListenerContainer(); dmlc.setConcurrency("1-5"); dmlc.setConnectionFactory(sqsConnectionFactory); dmlc.setDestinationName(queueProperties.getName()); dmlc.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE); dmlc.setMessageListener(messageListener); dmlc.setErrorHandler(customErrorHandler);
Issue here is, when the custom error handler executes handleError it does not acknowledges the message and message stay in the queue forever... I can see below message in logs
WARN com.amazon.sqs.javamessaging.acknowledge.RangedAcknowledger - SQSMessageID: 46a04726-8e09-48ce-947f-95cb2e8ae9a0 with SQSMessageReceiptHandle: 46a04726-8e09-48ce-947f-95cb2e8ae9a0#44b60e0f-2e02-42f1-a5c1-1db9a458b022 does not exist.
m I missing some configuration?
Regards,
Sumit
The text was updated successfully, but these errors were encountered: