Configuring BWAgent for PostgreSQL and TIBCO Enterprise Message Service

The BWAgent can be configured to use PostgreSQL database with TIBCO Enterprise Message Service (EMS) for persistence and transport.

Note: The database name must be unique per agent network if multiple networks share the same physical database. BWAgent and BW Engine supports sharing the same database, users and schemas.

Prerequisites

  • Install TIBCO Enterprise Messaging Server 8.1 and start the server.
  • Install PostgreSQL. The PostgreSQL driver is available by default.
  • Ensure you have installed EMS client libraries. For more information, see the "Integrating with TIBCO Enterprise Message Service™" section in the TIBCO ActiveMatrix BusinessWorks™ Installation guide.
  • Optional. If you are upgrading to ActiveMatrix BusinessWorks™ 6.3.2, or later versions of the software, upgrade the database schema. For more information, see the "Updating the Database Schema to Enable bwagent to Use Database with TIBCO Enterprise Message Service" section in the TIBCO ActiveMatrix BusinessWorks™ Installation guide.

Procedure

  1. After installing PostgreSQL, create a database bwadmindb and the database owner, bwuser as described in the following steps:
    1. Run the following commands on the psql terminal:
      > psql -p 5432 -c "CREATE USER bwuser WITH CREATEDB PASSWORD 'bwuser';"
      > psql -p 5432 -c "CREATE DATABASE bwadmindb WITH OWNER bwuser;"
    2. To add a password for the database owner, expand Login Roles > bwuser, right-click and choose Properties. Choose the Definition tab and create and save a password.
  2. Stop the bwagent if it is running.
  3. Open the bwagent_db.json file located in BW_HOME\config (Windows) or ${BW_HOME}/config (Unix).
  4. Update the following properties for your environment:
    Property Name PostgreSQL Value
    dbtype postgresql
    dbdriver org.postgresql.Driver
    dbconnectionURL jdbc:postgresql://localhost:5432/bwadmindb
    dbuser bwuser
    dbpassword bwuser
  5. Run the bwadmin config command with the -cf option push the changes from the JSON file to the bwagent.ini file.
    BW_HOME\bin>bwadmin config -cf ../config/bwagent_db.json agent
  6. Restart the bwagent.
  7. Open the pgAdmin III utility and expand Schemas > Tables in the Object Browser to view the tables in the database: