# AMQP client from AWS lambda that works with Solace

**URL:** <https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993>\
**Category:** Connectors & Integrations\
**Created:** [October 18, 2021, 7:23am UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993 "2021-10-18T07:23:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsingh81](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/rsingh81/32/1570_2.png) [@rsingh81](https://community.solace.com/u/rsingh81)\
**Post date:** [October 18, 2021, 7:23am UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993/1 "2021-10-18T07:23:30Z")

</div>

Hi, we would like to publish to Solace topic from AWS lambda ( written in java). Is there any java AMQP client library that we can use to do that ?

---

<div class="post-metadata">

**Author:** ![marc](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/marc/32/2191_2.png) [@marc](https://community.solace.com/u/marc)\
**Post date:** [October 18, 2021, 9:24pm UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993/2 "2021-10-18T21:24:26Z")

</div>

Hey @rsingh81,

The Solace Broker supports AMQP 1.0, so as long as you’re using a client library that works with v1.0 you should be fine. We usually see folks use the QPID library.

Note that if you’re not already familiar with AMQP it can be confusing to get started so you might consider using a MQTT, JMS, or SMF library. From a Lambda function it might even make sense to use REST messaging as you may not need to include extra libraries. If you go to [https://solace.dev](https://solace.dev), scroll down to “Connect Using a Supported Client Library” and choose “Java” you’ll see some of the options available.

Hope that helps!

 ![image.png](https://canada1.discourse-cdn.com/solace/original/1X/0078de834ba15ea358126acab362cad7470ee418.png)

---

<div class="post-metadata">

**Author:** ![Tamimi](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/tamimi/32/2190_2.png) [@Tamimi](https://community.solace.com/u/Tamimi)\
**Post date:** [October 19, 2021, 12:31am UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993/3 "2021-10-19T00:31:03Z")

</div>

Hey @rsingh81, feel free to share your findings here as well!

---

<div class="post-metadata">

**Author:** ![rsingh81](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/rsingh81/32/1570_2.png) [@rsingh81](https://community.solace.com/u/rsingh81)\
**Post date:** [November 5, 2021, 6:00am UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993/4 "2021-11-05T06:00:49Z")

</div>

We have gone ahead with the REST based calls.  
That said, we still want to load test our calls from AWS lambda  
We will have about 50k records to be published to Solace.  
Is it better for us to publish as batches ?

---

<div class="post-metadata">

**Author:** ![Tamimi](https://yyz1.discourse-cdn.com/solace/user_avatar/community.solace.com/tamimi/32/2190_2.png) [@Tamimi](https://community.solace.com/u/Tamimi)\
**Post date:** [November 7, 2021, 1:36am UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993/5 "2021-11-07T01:36:49Z")

</div>

Hey @rsingh81 - if everyone of those 50k records will be processed by an AWS Lambda function call, then you can publish each record separately from your lambda function. I am not sure how your lambda function architecture is setup but a batch approach could also work.

How are you processing your 50k records?

---

<div class="post-metadata">

**Author:** ![ranjitsingh](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@ranjitsingh](https://community.solace.com/u/ranjitsingh)\
**Post date:** [January 14, 2022, 12:14am UTC](https://community.solace.com/t/amqp-client-from-aws-lambda-that-works-with-solace/993/6 "2022-01-14T00:14:45Z")

</div>

Thanks @Tamimi, sorry it took so long to get back to this.  
Our logic to call from AWS lambda is written in java  
something like this

1. Call to lambda Handler Function → 2. Get all the records in one go to publish downstream → 3.Calls Solace REST publishiser look something like this ![image.png](https://canada1.discourse-cdn.com/solace/original/1X/444bb468ccd4895166bbcee13e3fa4d95b349d69.png)

My preference is to publish one records at a time, as then it can be more elegantly handled on the consumer side. I am bit concerned how will AWS lambda work underneath the hood when connecting to Solace broker i.e. if we perform step 3 above for each of the 50k record, I don’t want to hog the available connections for the Solace pub/sub +. Would you be able to advise on this whether connections will be reused or created one for each record published to Http?
