How To Use Openlegacy SQS Consumer

Prerequisite:

  • A working SQS with input and output queues.

  • A working SDK project.

  • Template SQS global consumer project.

 

Step 1: Clone OL SQS connector

  1. Pull sqs-clobal-consumer repo from Openlegacy GitHub (ask permissions if needed).

  2. Got to the project directory and build it with maven ./mvnw clean -DskipTests source:jar install.

Step 2: Create an API project

  1. Import ol-sqs-global-consumer-template to your workspace.

  2. Create an API project from ol-sqs-global-consumer-template.

     

  3. Add an SDK project and Finish.

Step 3: customize your API project

  1. Go to the API project's pom.xml and change the version according to your IDE.

2. Go to project’s application.yml file and edit the SQS configuration

ol: # SQS configurations # sqs: global-consumer: access-key: #your AWS access-key secret-key: # your AWS secret-key region: # the region in your AWS from-queue: #input queque to-queue: #output queue

3. Generate service from SDK.

Now you have an API with SQS connector.

Step 4: Test your SQS API

  1. Go to AWS SQS and send a message from the input queue, for example (in case of using CICS MF ItemDetails example):

    { "itemNum": 1000 "method": "item" }

“method”= the service’s name.

 

2. Go to the output queue and you would receive the service’s output as a message.