Skip to content

siwany/draft-guide-concurrency-intro

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running tasks asynchronously or parallelly in Java microservices

Note
This repository contains the guide documentation source. To view the guide in published form, view it on the Open Liberty website.

Learn how to run tasks asynchronously or parallelly in Java microservices by using Jakarta Concurrency APIs.

What you’ll learn

Introduction

  • explain Jakarta Concurrency APIs

  • describe the application

Application architecture where inventory service uses the Jakarta Concurrency APIs to call the system service.

Try what you’ll build

Polish the following instruction.

Navigate to the finish directory.

cd finish

Start inventory service in dev mode:

mvn -pl inventory liberty:run

Start system service in dev mode:

mvn -pl system liberty:run

Visit http://localhost:9080/openapi/ui for inventory REST APIs that perform asynchronous or parallel tasks

Creating asynchronous tasks in the InventoryManager bean

  • start the dev mode

  • create the InventoryAsyncTask utility class

  • create and explain asynchronous task

  • replace the InventoryResource class

  • add/update REST endpoint to call asynchronous task

Calling the system service in parallel

  • start the dev mode

  • replace the InventoryAsyncTask utility class

  • create and explain parallel task

  • replace the InventoryResource class

  • add/update REST endpoint to call parallel task

Testing the inventory application

Running the tests

Great work! You’re done!

You have just …​ by using Jakarta Concurrency APIs in Open Liberty.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 98.2%
  • Shell 1.8%