![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@teaming/serverless-offline-sqs
Advanced tools
Emulate AWS λ and SQS locally when developing your Serverless project
This Serverless-offline plugin emulates AWS λ and SQS queue on your local machine. To do so, it listens SQS queue and invokes your handlers.
Features:
First, add serverless-offline-sqs
to your project:
npm install serverless-offline-sqs
Then inside your project's serverless.yml
file, add following entry to the plugins section before serverless-offline
(and after serverless-webpack
if presents): serverless-offline-sqs
.
plugins:
- serverless-webpack
- serverless-offline-sqs
- serverless-offline
To be able to emulate AWS SQS queue on local machine there should be some queue system actually running. One of the existing implementations suitable for the task is ElasticMQ.
ElasticMQ is a standalone in-memory queue system, which implements AWS SQS compatible interface. It can be run either stand-alone or inside Docker container. See example sqs
service setup.
We also need to setup actual queue in ElasticMQ server, we can use AWS cli tools for that. In example, we spawn-up another container with aws-cli
pre-installed and run initialization script, against ElasticMQ server in separate container.
Once ElasticMQ is running and initialized, we can proceed with the configuration of the plugin.
Note that starting from version v3.1 of the plugin, it supports autocreation of SQS fifo queues that are specified in the cloudformation Resources
.
The configuration of function of the plugin follows the serverless documentation.
functions:
mySQSHandler:
handler: handler.compute
events:
- sqs: arn:aws:sqs:region:XXXXXX:MyFirstQueue
- sqs:
arn: arn:aws:sqs:region:XXXXXX:MySecondQueue
- sqs:
queueName: MyThirdQueue
arn:
Fn::GetAtt:
- MyThirdQueue
- Arn
- sqs:
arn:
Fn::GetAtt:
- MyFourthQueue
- Arn
- sqs:
arn:
Fn::GetAtt:
- MyFifthQueue
- Arn
resources:
Resources:
MyFourthQueue:
Type: AWS::SQS::Queue
Properties:
QueueName: MyFourthQueue
MyFifthQueue: # Support for Fifo queue creation starts from 3.1 only
Type: AWS::SQS::Queue
Properties:
QueueName: MyFifthQueue.fifo
FifoQueue: true
ContentBasedDeduplication: true
The configuration of aws.SQS
's client of the plugin is done by defining a custom: serverless-offline-sqs
object in your serverless.yml
with your specific configuration.
You could use ElasticMQ with the following configuration:
custom:
serverless-offline-sqs:
autoCreate: true # create queue if not exists
apiVersion: '2012-11-05'
endpoint: http://0.0.0.0:9324
region: eu-west-1
accessKeyId: root
secretAccessKey: root
skipCacheInvalidation: false
FAQs
Emulate AWS λ and SQS locally when developing your Serverless project
The npm package @teaming/serverless-offline-sqs receives a total of 1 weekly downloads. As such, @teaming/serverless-offline-sqs popularity was classified as not popular.
We found that @teaming/serverless-offline-sqs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.