Ask Your Question
1

Trigger Email executor when there is no data available in JDBC consumer?

asked 2017-11-30 13:18:50 -0500

Roh gravatar image

updated 2017-12-08 14:43:08 -0500

My JDBC query consumer origin runs every 15 minutes, it will basically have a query something like this select * from schema.table were timestamp > ${offset}.

Sometimes when there is no data in the source I would have to check the table or look at the pipeline to know that there is no data available after a certain time in the source. How can I keep an email executor that can notify me when there is no data available for that run?

I tried by setting an email executor to the event from JDBC consumer with the condition as this ${record:eventType() == 'jdbc-query-failure'} and its not working.

Any help will be much appreciated !!

edit retag flag offensive close merge delete

Comments

Did you get it working or not? It's not really clear from the changes you made to your question.

metadaddy gravatar imagemetadaddy ( 2017-12-08 14:34:01 -0500 )edit

Its working, I will remove the pictures.

Roh gravatar imageRoh ( 2017-12-08 14:42:53 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-11-30 17:23:51 -0500

metadaddy gravatar image

The event you should look for is jdbc-query-success, since the query is successful, there's just no data. This event has a rows value that will be zero if the query returned no rows. You can use a Stream Selector or precondition to filter on ${(record:eventType() == 'jdbc-query-success') && (record:value('/rows') == 0)} so you get the email at whenever the query is returning zero rows.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-11-30 13:18:50 -0500

Seen: 33 times

Last updated: Dec 08 '17