TIBCO Adapter: Step By Step Tutorial For Adapter Subscription Service

In our previous tutorial, we learned how to use TIBCO Adapter Publication Service to get data from a database and make it available in our TIBCO business process. In this step by step TIBCO Adapter Subscription Service tutorial, you will learn how to use adapter subscription service to insert data in a database table.

When running as a subscriber, TIBCO adapter listens on a subject, receives messages and updates the relevant tables in its associated database. The data is then available to other applications that have access to the database.

In this tutorial, we will use adapter subscription service for inserting data from TIBCO business process into a database table TBL_EMPLOYEE_SUB. Below is complete tutorial step by step:

Step 1: Create Database Table

We will use same database schema and db connection as we used in our adapter publishing service tutorial. In the database, create a new table TBL_EMPLOYEE_SUB using below script:

— Create table
create table TBL_EMPLOYEE_SUB
(
EMP_CODE        VARCHAR2(20),
EMP_NAME        VARCHAR2(30) not null,
EMP_DESIGNATION VARCHAR2(30) not null,
EMP_AGE         VARCHAR2(10)
)

Step 2: Configure Adapter Subscription Service

Our Adapter Configuration is already there which we did in Adapter Publisher tutorial Step 2. We only need to add a new adapter service in Adapter Services Folder by choosing Subscription Service. In the Table tab of its configuration, add the table name TBL_EMPLOYEE_SUB. Table columns will be added as shown below:

 

adapter subscriber service add table

 

We don’t need to make any changes to other configuration tabs. We are simply done with configuration of our Adapter Subscription service. Adapter Subscriber service icon turns blue if it has no issues. If its color is Pink, click on Apply Button in the Table tab and see if it turns blue.

 

Step 3: Create TIBCO Process to Publish to Adapter Subscription Service

We need to create a business process from which we will Publish some data towards our TIBCO Adapter Subscription service so that it may be written to our database table. In the Processes folder of project, I have created a new process EmployeePublisher in which Publish To Adapter activity is used as shown below.

 

process for publishing to adapter subscription service

 

In the configuration tab of Publish to Adapter activity, choose Tibco Adapter Subscription service that we created in Step 1.

publish to adapter configuration

In the transport tab of this activity, no change is required in our tutorial example and we will go with the default. We can see in below snapshot that Subject is same as that of our Subscription Service, so it will publish the message to our adapter subscription service.

publish to adapter transport tab

In the input tab of Publish to Adapter activity, we need to specify input data. We can see that in body, it asks for input values for all columns of our database table. I have specified some hard coded values here just as an example. In practical scenarios, this data should be coming from some other source in the process starter.

publish to adapter input data mapping

 

Step 4: Start Adapter Tester

After completing all required configuration changes of our process, we are now good to go for testing phase. First we need to start Adapter Tester by choosing Tools–>Show Adapter Tester

start tibco adapter tester

 

 

Step 5: Run Process in Designer Tester

In designer tester, load the process EmployeePublisher and start it.

load process in tester

You will see that process runs successfully and publishes data to the Adapter Subscription service as shown below:

test adapter subscription service by publish to adapter

 

Step 6: Verify Adapter Subscription Service Results

Now our last step of this tutorial is to verify that our adapter subscription service has inserted the data in database table TBL_EMPLOYEE_SUB.

Run following query:

select * from tbl_employee_sub

And below are query results:

data in database table added by adapter

So it shows that our Adapter Subscription service has successfully written data in database table.

Ajmal Abbasi

Ajmal Hussain Abbasi is Integration Consultant By Profession with 13+ years experience in Integration domain mainly with TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Cloud, TIBCO Flogo, TIBCO Mashery, TIBCO Spotfire, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in various sectors by using his skills in TIBCO Flogo, TIBCO API Management (Mashery), TCI, Tibco Designer, TIBCO Business Studio, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi has experience with MuleSoft ESB as well. Ajmal Abbasi is also experienced in the area of API Management particularly with WSO2 API management platforms. Ajmal Abbasi is also experienced in developing solutions using Core Java and J2EE Technologies. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn - YouTube

6 thoughts on “TIBCO Adapter: Step By Step Tutorial For Adapter Subscription Service

  1. Pingback: Tibco Database Adapter: Step By Step Tutorial | Tibco Guide

  2. Mahesh Reddy

    Hi,

    Can anyone please let me know how to insert multiple records using adapters

    Reply
    1. Divya

      Hi

      You can insert multiple records by applying a group to the Publish to Adapter Activity.

      Reply
  3. meriouma9

    Hi,

    II am looking for a tutorial that explains the use of Copybook palette.

    Reply
  4. meriouma9

    how to convert an XML file to a flat file using TIBCO BW?

    how to convert a flat file to an XML file using TIBCO BW?

    how to convert a CCV file to an XML file using TIBCO BW?

    Reply
  5. Dhirendra Gautam

    My flow is running correctly but i amm unable to see the input data in the table.Kindly help

    Reply

Leave a Reply to meriouma9 Cancel reply

Your email address will not be published. Required fields are marked *