View previous topic :: View next topic |
Author |
Message |
analyst Beginner
Joined: 10 May 2007 Posts: 11 Topics: 8
|
Posted: Wed Mar 31, 2010 7:14 am Post subject: Trigger mechanism to write to MQ When a row is inserted Db2 |
|
|
I need design help in the following case:
I am writing records into DB2 Table from different transactions.Once the records are written into a table I need to put that data into MQ Message on real time basis..means whenver a new record is inserted into the table I need to run my batch process.Say for exapmle there is no record inserted for 2 hours I do not want to run that batch job for that period..What is the best way of doing this..
we are using TWS as the scheduler..is there any job trigger possible based on the insert record into DB2 table?? Any ideas about the best design.. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Mar 31, 2010 8:29 am Post subject: |
|
|
Quote: | is there any job trigger possible based on the insert record into DB2 table? |
any triggering mechanism based on a DB2 INSERT would involved extra load on DB2, which you do not want to do.
before offering any suggestions, have 1 question:
how involved is the batch job? 1 step/program or several? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
RonB Beginner
Joined: 02 Dec 2002 Posts: 93 Topics: 0 Location: Orlando, FL
|
Posted: Wed Mar 31, 2010 10:13 am Post subject: |
|
|
Why initiate a batch process when your requirement is to put the data into an MQ message on a real-time basis? Why not just post a message into the MQ from within the same program that does the DB2 insert, and be done with it? _________________ A computer once beat me at chess, but it was no match for me at kick boxing. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Mar 31, 2010 10:21 am Post subject: |
|
|
Ron,
could be the db2 insert is done in cics and the 'batch process' is rather long or involved.
he already said his communication mechanism would be MQ (from db2 insert to batch process - what ever that is) and he would be writing the msg from the same module/process that does the db2 insert.
his problem is how to kick off the batch job to process the mq msg.
there are several alternatives - based on the complexity/size of the batch job,
a good solution can be provided,
but an understanding of the batch process is necessary. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Wed Mar 31, 2010 10:57 am Post subject: |
|
|
One method is an MQ "trigger monitor" program running as a started task. It can watch the queue and issue an MVS console command to submit the batch job as messages arrive. You can buy a trigger monitor program or write your own. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
|
RonB Beginner
Joined: 02 Dec 2002 Posts: 93 Topics: 0 Location: Orlando, FL
|
Posted: Wed Mar 31, 2010 2:03 pm Post subject: |
|
|
dbzTHEdinosauer wrote: | he already said his communication mechanism would be MQ (from db2 insert to batch process - what ever that is) and he would be writing the msg from the same module/process that does the db2 insert. |
It appears that your interpretation of what he "said" differs from my interpretation. From his statement that he "NEED[s] to put that data into MQ message on real time basis...MEANS whenever a new record is inserted into the table [he] need[s] to run [his] batch process", combined with the thread title (i.e. Triggermechanism to write into MQ When a row is inserted Db2 ), I inferred that he was looking for a way to trigger the batch process ( to do the insert ), on a real-time basis, whenever an insert to the DB2 table occurred ( regardless of which, of perhaps several, program(s) actually does the insert ). Hence my suggestion that he post the MQ message from the inserting program. I failed to mention what Bill posted - namely that an MQ trigger monitor program kick off whatever the OP hoped to accomplish following the posting of the MQ message. |
|
Back to top |
|
|
analyst Beginner
Joined: 10 May 2007 Posts: 11 Topics: 8
|
Posted: Wed Mar 31, 2010 7:12 pm Post subject: |
|
|
dbz..My batch process is a single program,but it does lot of calculations but it is a single program/job ..Thanks for the load information .[Db2 trigger is an extra load]
Ron: Different IMS DC (DB2) and ADF transactions say around 20 are putting the messages into DB2 table..currently we do not have transactions which are putting data into MQ.If you have already done could you please confirm this..I am checking this with IMS DBA after this..That will be solution to my problem.
Bill..Once a message is put into MQ..the TRIGINT parametrer triggers the Batch job..this mechanism is fine and currently working..If IMS transaction can put the message into MQ that will solve my problem completely,but need to use 2 MQ Qs..that is fine.
Thank you very much for your replies..
By IMS transaction if I can not put the msg into MQ then I can only insert that data into a DB2 table.I need to process the data in the table and need to send it to MQ. |
|
Back to top |
|
|
|
|