Recently IBM App Connect released
IBM App Connect Enterprise 11.0.0.11, which included a number of new capabilities. One of the great features introduced was the Db2 driver is now included in the shipped binaries. This enables you to configure App Connect Enterprise to connect directly to Db2 without having to install the Db2 client, this is even more valuable in App Connect Enterprise certified containers where custom images are normally required to add the Db2 Client.
Below are instructions on how you can use this new capability in an Integration Server created by the App Connect operator. Before continuing I would recommend reading the blog linked above to understand how the new capability works.
Configuration
The configuration breaks down into 4 configurations.
odbc.ini
This is supported as a primary configuration type. Create a file with the contents of the odbc.ini such as;
[ODBC Data Sources]
USERDB=IBM Data Server Driver included in ACE
;# IBM Data Server Driver included in ACE
[USERDB]
DRIVER=/opt/ibm/ace-11/server/ODBC/dsdriver/odbc_cli/clidriver/lib/libdb2o.so
Description=IBM Db2 ODBC Database accessed using IBM Data Server Driver included in ACE
Database=USERDB
[ODBC]
InstallDir=/opt/ibm/ace-11/server/ODBC/drivers
UseCursorLib=0
IANAAppCodePage=4
UNICODE=UTF-8
odbcinst.ini
This is already configured in the container and is located in /opt/ibm/ace-11/ie02/etc
db2cli.ini
Create a file called "db2cli.ini" with the following contents updating the details accordingly
[USERDB]
Hostname=9.145.146.224
Port=50000
Database=USERDB
setdbparms
Create a file called "setdbparms.txt" with the following contents updating the details accordingly
mqsisetdbparms -w /home/aceuser/ace-server -n USERDB -u <userId> -p <password>
Deploy Configurations
Create the odbc configuration type. Pipe the odbc.ini file into base64 to get a base64 encoded version of the file i.e.
cat odbc.ini | base64
. Create a file (`odbcini.yaml`) with the following contents, taking the base64 output and update the following file in the data sections
apiVersion: appconnect.ibm.com/v1beta1
kind: Configuration
metadata:
name: db2-odbcini
namespace: mynamespace
spec:
data: <InsertDataHere>
description: Configuration for Db2
type: odbc
Deploy the configuration using
oc apply -f odbcini.yaml
Next zip up `db2cli.ini` into a file called `extensions.zip`. Pipe the zip file into base64 to get a base64 encoded version of the file i.e.
cat extensions.zip | base64
. Next we need to create an "extension" configuration type, create a file (`generic.yaml`) with the following contents, taking the base64 output and update the following file in the data sections
apiVersion: appconnect.ibm.com/v1beta1
kind: Configuration
metadata:
name: extensions.zip
namespace: mynamespace
spec:
data: <InsertDataHere>
description: Files for configuring Db2
type: generic
Deploy the configuration using
oc apply -f generic.yaml
Next pipe setdbparms file into base64 to get a base64 encoded version of the file i.e.
cat setdbparms.txt | base64
. Next we need to create a "setdbparm" configuration type, create a file (`setdbparms.yaml`) with the following contents, taking the base64 output and update the following file in the data sections
apiVersion: appconnect.ibm.com/v1beta1
kind: Configuration
metadata:
name: db2-creds
namespace: mynamespace
spec:
data: <InsertDataHere>
description: Configuration for Db2
type: setdbparms
Deploy the configuration using
oc apply -f setdbparms.yaml
Deploy and Configure Server
Next we need to create an integration server with the configurations attached by adding the following
apiVersion: appconnect.ibm.com/v1beta1
kind: IntegrationServer
metadata:
name: db2
namespace: ace
spec:
license:
accept: true
license: L-APEH-BSVCHU
use: AppConnectEnterpriseProduction
version: 11.0.0
replicas: 1
barURL: <barURL>
configurations:
- extensions.zip
- db2-odbcini
- db2-creds
pod:
containers:
runtime:
resources:
limits:
cpu: 300m
memory: 300Mi
requests:
cpu: 300m
memory: 300Mi
adminServerSecure: true
router:
timeout: 120s
useCommonServices: false
designerFlowsOperationMode: disabled
Once the integration has started up, patch the deployment with the extra environment variable needed by the Db2 client:
oc set env deployment/<isName>-is DB2CLIINIPATH=/home/aceuser/generic
After applying the patch command the deployment should create new integration server pods which are fully configured and ready to connect to Db2.
#ACEV11#acecc#AppConnectEnterprise(ACE)#Db2