BizTalk Receive Location - CSV File - Only Column Headers - Alert Email

Hello

We have a receive location that receives a CSV file every day that contains rows of data that gets debatched and processed (Maps applied on receive port and send port) by BizTalk and passed on to down stream WCF systems. There are no orchestrations involved and this is purely done by a pipeline debatching and publishing the messages (after applying map) and a send port subscribing for these and sending off to down stream WCF service.

It works well but we have a new requirement to raise alert emails when the file is received with

1) No information - The file is totally blank

2) Only Column headers - No rows of information

I managed to solve the first issue by setting up a alert in our network monitoring tool WhatsUpGold by looking for a warning message written to eventlog by BizTalk when it receives a blank file in the receive location.

I am not sure how to achieve the second requirement. Any suggestions are most welcome.

Thank You. 

August 21st, 2015 4:21am

May be you can solve second one in custom pipeline componet where you can see if it has only headers and create a specific message with a type and subscribe that message with a smtp port.
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 5:00am

Hi,

I can think of 2 options to check if the file is having data or not:

  • Create a custom pipeline component to check the no of rows using XPath and depending on the No of messages take the appropriate action
  • Add an orchestration and check the count of rows using XPath and based on that take the action.
  • If you have a requirement to send even the empty file with no data then probably you can have two subscribers of the file (2 send ports). One is actually sending the to the WCF service and the other to get the file in a folder. You can then write a small utility which checks the file to see if it vcontains the rows or not and based on that trigger an alert email. This approach is not very much synchronous and can be considered if you do not want to change the current BizTalk flow.

Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

Rahul

August 21st, 2015 5:26am

Depending on how you Schema is structured, you can set the MinOccurs for the data rows to 1, then the XmlValidator component to validate the message.  It will throw an error you can intercept with Failed Message Routing.
Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 7:25am

Hi,

I can think of 2 options to check if the file is having data or not:

  • Create a custom pipeline component to check the no of rows using XPath and depending on the No of messages take the appropriate action
  • Add an orchestration and check the count of rows using XPath and based on that take the action.
  • If you have a requirement to send even the empty file with no data then probably you can have two subscribers of the file (2 send ports). One is actually sending the to the WCF service and the other to get the file in a folder. You can then write a small utility which checks the file to see if it vcontains the rows or not and based on that trigger an alert email. This approach is not very much synchronous and can be considered if you do not want to change the current BizTalk flow.

Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

Rahul

August 21st, 2015 9:23am

Hi,

I can think of 2 options to check if the file is having data or not:

  • Create a custom pipeline component to check the no of rows using XPath and depending on the No of messages take the appropriate action
  • Add an orchestration and check the count of rows using XPath and based on that take the action.
  • If you have a requirement to send even the empty file with no data then probably you can have two subscribers of the file (2 send ports). One is actually sending the to the WCF service and the other to get the file in a folder. You can then write a small utility which checks the file to see if it vcontains the rows or not and based on that trigger an alert email. This approach is not very much synchronous and can be considered if you do not want to change the current BizTalk flow.

Please indicate "Mark as Answer" or "Mark as Helpful" if this post has answered the question

Rahul

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 9:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics