Global Cache in IBM ACE 12

What to cover:

1. Implement cache on integration node.

Step 1:

Create new application project and named as what ever you want.

Step 2:

In my case I’ve named application as CacheApp and create 2 flows named CacheUpdate and CheckCache.

Step 3:

Create java project inside you IBM App connect Cache application project. And in Java create package called com.java.cache and inside package create class called CacheUtil.java.

Step 4:

Write below java code on CacheUtil.java class which you’ve created on step 3.

Step 5:

Below is the message flow of CacheUpdate which we have created in step 2. The purpose of this flow to read file where we placed data of configuration parameters (Other than file be it database for storing values. It totally depends on you.) The data read from file then parse and put on Java cache collection through java method on ESQL. The java method with complete code defined in previous step. The is API message flow endpoint is defined on first (HTTP input node) when we hit endpoint and the data stored on file will be updated on cache and return successful response. Incase any failure then exception is printed with reason.

ESQL Code for Cache Update

CREATE COMPUTE MODULE ReadFile_UpdateCache

Step 6:

Below is the message flow of CheckCache which we created in step 2. This is also HTTP API message flow endpoint is defined on first (HTTP input node) then try catch for exception handle then ESQL node for getting value from cache stored against particular key to check weather cache is working on not and what value against this key is present on cache. The last node HTTP reply to return successful response incase no exception is generated during runtime of flow. If any exception during flow runtime then it goes to Failed response ESQL node and exception is log and return with reason as service response.

ESQL Code for Get Cache Value

CREATE COMPUTE MODULE CheckCache_GetValue

Step 7:

In this step we create an integration node named as LearningNode using IBM App connect command console.

Step 8:

Now create 2 integration server named as LearnEG1 and LearnEG2 on integration node LearningNode as seen in below commands.

Step 9:

Open server.conf.yaml for LearnEG1 file exist on this path C:\ProgramData\IBM\MQSI\components\LearningNode\servers\LearnEG1 and paste below mention GlobalCache section configuration under ResourceManagers section in server.conf.yaml file.

Step 10:

Open server.conf.yaml for LearnEG2 file exist on this path C:\ProgramData\IBM\MQSI\components\LearningNode\servers\LearnEG2 and paste below mention GlobalCache section configuration under ResourceManagers section in server.conf.yaml file.

Step 11:

Restart both EG using IBM App Connect command console using below commands.

Step 12:

Deploy CacheApplication which we created in step 1 along with Java project which reside inside the application now deploy in any of the EG you created in step 8.

--

--

Currently working as Full stack Java developer at Contour Software. Working on Java and IBM stack.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adil Abdullah

Currently working as Full stack Java developer at Contour Software. Working on Java and IBM stack.