TSQ Async
These are the steps to create the full flow as should be implemented at DBS
Step 1 - Create Kafka Producer
Open the New Project Wizard:
File → New → OpenLegacy SDK Project
Define the Project Name as kafka-producer
Click at the Default Package field, to automatically fill it up.
Select Kafka as the backend and click Next
Click on Add and set the host details:
Host:
kafka-sandbox.openlegacy.com
Port:
9092
Default Producer Topic:
mf-to-kafka
Click Finish
Step 2 – Generate Java Model (Entity) from the Cobol Sources
Copy ITEMDET.cbl to your samples folder at
src/main/resources/sample
ITEMDET.cbl
Right-Click on the
ITEMDET.cbl
file → OpenLegacy → Generate ModelExecution Path:
ITEMDET
Check Generate JUnit Test checkbox
Click OK
Step 3 – Create API consumer
Open the New Project Wizard:
Open new API project wizard:
File → New OpenLegacy → API Project.
Define the Project name as
mf-consumer
.Click at the Default Package field, to automatically fill it up.
Select Legacy HTTP as the service type and click Next
Click on Add and set the host details:
Path To Expose:
/api/itemdet
Host Port:
9092
Code Page:
CP037
Click Finish
Step 4 – Generate APIs from SDK
Right-Click on the mf-consumer project → OpenLegacy → Generate API from SDK
Name the service
Itemde
Select from the
Itemde
model as inputSelect from the
Itemde
model as outputClick OK
Step 5 – Run and deploy the API
Right-click on the API project and select Run As → Maven clean
Right-click on the project and select Maven → Update Project…
The IP which the program calls is defined in the CICS program, therefore, we need to deploy the project to a server with a static IP, currently the server which we use is 172-31-2-53 with the user ubuntu, to get a Pem in order to connect, ask Alex or Ruslan.
3. Copy the Jar that you creted to the server, and run it with
java -jar ./<jar-name>