Lambda function for Java implementation

Hello,

Let me start with a general explanation.

We are building a functionality allowing you to scan a list of Amazon S3 files and decode QR codes on some of these images. This function is a part of the whole project and it is going to be run occasionally. Probably XX times a week. The rest functionality does not require a powerful server, and to make our costs lower we think it would be a better idea to have this feature as a lambda function.

  1. We aim to build a Java version, but flexible with .net & python solution also if needed
  2. We want the fastest solution

Any idea if you solution can work as a Lambda function? Do you have any examples/tutorials? Any bottle necks there? As our trial version didn’t work well there. It just times out with no result.

Thanks in advance for your assistance and advice.

@vbezruchkin,

Like other Aspose libraries, you may also use Aspose.BarCode .NET SDK to work on AWS lambda function. So, kindly give it a try. In case, you face any issue, let us know with details.

Reference docs (although it applies to other Aspose SDKs):

Hi,

Thanks for your response. What about Java, please?

Thanks

@vbezruchkin,

I think you can use Aspose.BarCode for Java on AWS Lambda. Aspose.BarCode is a pure Java-based library that can be integrated with any Java application or framework (which supports JDK/JRE), including AWS Lambda.

To use Aspose.BarCode for Java on AWS Lambda, you might need to create a deployment package that includes the Aspose.BarCode library and any other dependencies required by your Lambda function. You can then upload this deployment package to your Lambda function.

Sample steps to create a deployment package for Aspose.BarCode for Java on AWS Lambda:

  1. Create a Java project that uses Aspose.BarCode for Java.
  2. Build your Java project and generate a JAR file that includes all required dependencies.
  3. Create a new AWS Lambda function and upload the JAR file to the function.
  4. Set up any necessary triggers or permissions for your Lambda function.
  5. Test your Lambda function to ensure that it works as expected.

Please note the specific steps to deploy your Java application on AWS Lambda may vary depending on your specific requirements and implementation details.

1 Like

Thanks a lot. Cheers.

@vbezruchkin,

You are welcome.

We did exactly as described and we still experience one issue: the function times out when it reaches this line of code:

var barCodes = barCodeReader.readBarCodes();

The stream contains the binary object that is read from S3 like so:

var amazonS3 = getAmazonS3();
var s3Object = amazonS3.getObject(bucketName, objectName);
var inputStream = s3Object.getObjectContent();
var stream = new ByteArrayInputStream(inputStream.readAllBytes());
logger.log("S3 Object successfully read.");

We tried increasing the timeout up to two minutes and memory up to 1GB, which is more than enough for the function to complete, yet it times out. On the local machine a similar code finishes within 4-5 seconds.

Would you have any recommendations for resolving this issue?

Thanks in advance.

@pbastov,

Could you please search online resources or relevant forums to cope with timeout issues on your end:
e.g.,

If you still could not evaluate the issue, kindly share your sample project with sample barcode image(s). We will log appropriate ticket and investigate your issue.