Integrating PubSub+ Event Broker: Cloud with Lambda via API Gateway

hong
hong Guest Posts: 480 ✭✭✭✭✭

New blog post alert! In the blog, Himanshu Gupta, a Solutions Architect at Solace, walks you through how to use PubSub+ Event Broker: Cloud, lambda, and API Gateway together. Have you had a project that involved the three before? Share your experience with the Community in the comments below.

Serverless architecture is all the rage these days and nothing screams serverless like AWS Lambda. AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. When Lambda was announced a few years ago by AWS, it caused quite a bit of confusion but slowly it has gained popularity and become analogous to serverless architecture.

Lambdas, which is what most people call the services you spin up with Lambda, are powerful because they can be easily triggered and scaled without having to worry about the underlying infrastructure.
In this post, I would like to show you how you can send a message to a PubSub+ Event Broker running as a managed service on PubSub+ Event Broker: Cloud and use it to trigger a lambda through AWS’s API Gateway. And all of this without any code, except for the code you need for your Lambdas.

More specifically, I’ll walk you through the process of publishing a message to a topic that is being subscribed to by a queue. This is known as topic-to-queue mapping in the PubSub+ world. Once the message is received by the queue, it will be forwarded to API Gateway which will trigger the Lambda function.

We will be using REST Delivery Points (RDPs) to achieve this. An RDP is a provisioned object on a Message VPN that facilitates message delivery to REST consumers. For our use case, we will need an RDP to link our queue (which will receive the message) to the AWS API Gateway endpoint.

Here is what the architecture looks like:

Let’s begin!

Read the full blog: https://solace.com/blog/event-broker-cloud-lambda-aws-api-gateway/