Skip to main content
New

Generating Notification if a message is NOT processed for a length of time

Related products:CData Arc
  • June 12, 2023
  • 3 replies
  • 62 views

Forum|alt.badge.img+1

We have a common scenario where we receive orders by email daily at 09.30.

To avoid having to check each morning that we received an order and it was processed correctly, we’d like to have something that monitors if a connector does NOT process a message for say 25 hours.

Ideally we’d like to be able to put that logic on any connector. It might be that the order wasn’t received, or the order didn’t get all the way through the flow.

In the meantime, we will also look into using Nagios to monitor the Sent folder on particular connectors.

3 replies

James B
Forum|alt.badge.img
  • Employee
  • June 16, 2023

This partial response is a work in progress while I try to restore my original response:

 

There isn’t a feature of Arc that natively supports an inactivity check on a connector, but I can see two approaches to designing a process to do this. 

 

The first is to use the Admin API within the application to query the transactions API and if the results count is zero, proceed with an alert. 

 

The second is to use a Script connector to achieve the same basic result by querying the backend database for records: 

 

CData Arc - dbQuery | Version 23.0.8517

 

<arc:set attr="tmp.ringthebell" value="true" />

<arc:set attr="db.provider" value="System.Data.SQLite" />
<arc:set attr="db.conn" value="DataSource=C:\\Program Files\\CData Arc 8560\\db\\app_transactions.db" />
<arc:set attr="db.query">SELECT ID FROM app_transactions WHERE PortID='ReplaceISA02'
AND Direction = 'Send' AND Status = 'Success'
AND Timestamp > '2023-06-16'</arc:set>

<arc:call op="dbQuery" item="db">
<arc:set attr="tmp.ringthebell" value="false" />
</arc:call>

<arc:if exp="[tmp.ringthebell]">
<!-- Send Email -->
<arc:set attr="Subject" value="Connector ReplaceISA02 Idle!"/>
<arc:set attr="Message" value="Connector ReplaceISA02 Idle."/>
<arc:call op="appSendEmail" />
</arc:if>

 


James B
Forum|alt.badge.img
  • Employee
  • June 16, 2023

Sorry for the confusion Russell, I had a more complete response that was promptly eaten and discarded upon submission, so I am attempting to rewrite it all. 

 

Using the Admin API

 

The Professional edition of CData Arc and higher offers access to an administrative API, which allows you to drive through a series of API calls anything that you can perform in the UI:

 

CData Arc - Resources | Version 23.0.8517

 

In particular, the /transactions API can be used to query the application transactions table, and you can use an OData filter to target the transactions you want to search, for example, targeting a specific connector, send status, and data range:

 

 

This will return one record for each matching transaction in the table, and if there are none, you can proceed to alerting the user.


James B
Forum|alt.badge.img
  • Employee
  • June 16, 2023

Just a follow up on the script that I sent in the first resubmit - this instead uses the dbQuery operation to query against the backend database directly. Any of the parameters of the query can be made dynamic via the use of an expression. 

 

The script begins with an assumption that an alert is to be set, but this is turned off as soon as any query parameter is returned. Will either of these work for you?