How to use Event listener activity in MongoDB Plugin?

How to use Event listener activity in MongoDB Plugin?

book

Article ID: KB0079833

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks Plug-in for MongoDB 6.x

Description

After starting mongodb server without relica mode using command "mongod.exe --dbpath "c/data"" then the event listener won't able to listen to the event such as insert,update ordelete that is done on collection.

Issue/Introduction

How to use Event listener activity in MongoDB Plugin?

Environment

Product: TIBCO ActiveMatrix BusinessWorks Plug-in for MongoDB Version: 6.x OS: All Supported Operating Systems

Resolution


1). To run the event listener in BW 6.x requires to run MongoDB server in replica mode by using the command:

mongod.exe --dbpath "c/data" --replSet rs0 --oplogSize 100.

2). At MongoDB client:

a). Switched to local database using the command:
                use local

b). Then run the rs.initiate() property that initiates a replica set. Optionally, the method can take an argument in the form of a document that holds the configuration of a replica set.

c). Switched to the database that is used for DB operation using the command:
                use Database name

d). Do the Database operation such as insert, update, delete operation.

On rge MongoDB plugin side:

a).Create the MongoDB connection with database name then uses this connection to create the process consist of the insert, update, delete operations.

b).Configure the event listener with MongoDB connection and DBCollection name.When an event happens at database event listener will listen and process the data.

For more reference, refer to the sample project having an event listener.