awslabs / awslabs/amazon-sqs-java-temporary-queues-client

Unexpected exception during execution of AmazonSQSRequester sendMessageAndGetResponse

Open
#78 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
99
Forks
27
PR merge metrics
No merged PRs in 30d

Description

I have setup 2 java components.

The first with an AmazonSQSRequester to invoke the sendMessageAndGetResponse method.
The seconds component with an SQSMessageConsumer and AmazonSQSResponder to invoke the sendResponseMessage method.

I am using amazon-sqs-java-temporary-queues-client version 2.0.0

It generally seems to work and I can send a message a get a response back however there is a background thread that throws runtime exceptions kind of randomly. They are all having some kind of issue performing a base64 decode. The sendMessageAndGetResponse method always completes without exception and I receive the expected responses but these runtime exceptions noted below happen most of the time however not all of the time and are not trappable with the surrounding try/catch. I've attached a file with code fragments which setup my sqsRequester and the method to send the message.

[codefragments.txt](https://github.com/awslabs/amazon-sqs-java-temporary-queues-client/files/10326037/codefragments.txt)

For example:
ERROR 36420 --- [nsumer-Thread-1] c.a.services.sqs.util.SQSQueueUtils : Unexpected exception

java.lang.RuntimeException: Exception encountered while processing message with ID 2d10d2c9-9b28-46ea-b4fb-758dd9dffc5c
at com.amazonaws.services.sqs.util.SQSMessageConsumer.handleMessage(SQSMessageConsumer.java:158) ~[amazon-sqs-java-temporary-queues-client-2.0.0.jar:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[na:na]
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1654) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) ~[na:na]
at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:746) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:408) ~[na:na]
at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:736) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159) ~[na:na]
at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:661) ~[na:na]
at com.amazonaws.services.sqs.util.SQSMessageConsumer.poll(SQSMessageConsumer.java:122) ~[amazon-sqs-java-temporary-queues-client-2.0.0.jar:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.lang.IllegalArgumentException: Last unit does not have enough valid bits

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.