How to retrive all AWS SQS queue messages in lumen without dispatching - amazon-sqs

I am trying to fetch the AWS SQS queue messages using lumen Queue worker and SQS queue messages will be created by other API's which is on other end. How can I retrieve all the messages from queue and process it.
I have created the job and installed the AWS sdk package into the lumen but it is not calling the handle written into the Job.
Can anyone please guide me step by step to sort out the problem

Related

KMS Access Denied exception on SNS Topic to SQS queue

Background: I am trying to execute a lambda function by using a SQS queue as the trigger. And once the lambda function finishes executing, I am trying to send a response to another SQS queue via a SNS topic.
SQS Queue -> Lambda -> SNS topic -> SQS Queue
I initially tried to use Destinations to send Lambda's response to SQS, but that only works for async invocations and SQS is considered as a sync invocation. Fine. So now I trigger a SNS topic which then handles adding the message to the SQS queue. This integration works fine.
Problem: The SNS topic always ends up failing to post to the SQS queue. I can see that the deadletter queue has the messages always and never the actual queue. This is the error message I found on CloudWatch
{
"delivery": {
"providerResponse": "{\"ErrorCode\":\"KMS.AccessDeniedException\",\"ErrorMessage\":\"null (Service: AWSKMS; Status Code: 400; Error Code: AccessDeniedException; Request ID: c)\",\"sqsRequestId\":\"Unrecoverable\"}",
"dwellTimeMs": 51,
"attempts": 1,
"statusCode": 400
},
"status": "FAILURE"
}
I can see that KMS is denying access to something. But I'm not sure who is getting denied by KMS. The SNS topic has no encryption set. It is disabled. I initially enabled it, but after facing the problem, I disabled it. But the problem still persists.
What have I tried:
I've tried disabling and enabling the encryption on SNS topic settings.
I've tried looking at IAM roles associated with the SNS topic and SQS queue. Very few service roles were created and none of them have any restrictions.
As I was writing this question and crossing my t's and dotting my i's I stumbled upon the solution to my problem.
The encryption on the SQS queue side is configured from the Queue Actions (on SQS AWS Console) -> Configure Queue -> SSE section.
On the actual queue, the SSE option was selected with the default SQS KMS key while the dead letter queue had no setting and so could work without problems.
To solve this problem there are two possible solutions:
Uncheck the SSE section to stop using KMS keys. Depending on your use case encryption may be needed for you.
Create a separate key which you can share across SNS and SQS. By default the keys that are used by the two services cannot be shared.

Scheduled callback with Amazon Connect

Is it possible to build a flow that allows a user to schedule a callback from an Amazon Connect queue using the StartOutboundVoiceContact API?
It more about building something to do the scheduling or with Amazon Connect tasks you can create a task for an agent or queue to process the callback

Increase MQTT Time between PUBLISH and PUBCOMP

I have configured a MQTT subscriber in spring using spring mqtt integration. In the handleMessage method I am doing certain business logic which takes time. While testing I noticed that when I am sending bulk number of messages the Broker republishes the same message as an original message (I checked whether the Message payload is duplicate , it was sending as original). The MQTT Broker is publishing the message again even before the Subscriber can send PUCOMP. QOS level is set to 2
You should not be doing long running tasks in the handleMessage callback as this is run on the MQTT Clients network thread.
If you have a long running task you should be handing it off to a separate thread pool to run.

Gen_bunny (Erlang / Elixir) subscribe to queue (Rabbitmq) using bunnyc

Does anyone know how can I subscribe to Rabbitmq queue using gen_bunny?
I am able to connect and push the message and by using get method I can also receive message. However, I cant find out how to subscribe to a queue and get the message in my gen_server.

how to know when amazon machine instance start,stop and terminated? is there any way to send messege in sqs when instance start,stop and terminated?

who will notify when instance start or stop? i want to send message to sqs when instance start stop or terminated and sqs messeage will be read by DAS(Domain Administration server) asynchronously.
You may write commissioning and decommissioning scripts for your EC2 instances, wherein you may also send some message to any SQS queue.

Resources