Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book you Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Multithreaded HTTP polling – protocol.OldRow() returns null and Stream Viewer shows VT_EMPTY

Solved90 views10 hours agoHttp Communication Multithreaded Timer MultiThreadedTimerHttp performance
2
Srimathi Ramachandran [DevOps Member]196 3 days ago 0 Comments

Hello ,

I'm trying to implement multithreaded HTTP communication in a QAction by following the instructions in the (HTTP | DataMiner Docs) but I'm running into a couple of issues and would appreciate some guidance.

I have configured a multithreaded timer with:

  • QActionBefore (QAction 4) → creates the HTTP request

  • Group trigger (QAction 3) → processes the HTTP response

  • QActionAfter (QAction 5) → handles timeouts

Issue

  1. In QAction 3, when I try to retrieve the response using:
    var result = protocol.OldRow();
    it always returns null. In Stream Viewer, I see the following message:

    " Get for Multi threaded Timer - Periodic Monitoring {device-id} [0 ms] returned VT_EMPTY " for every row in the table (The table stores device URLs, and for each row we retrieve the URL and make an HTTP call to the device to check its status.)

    But when I test the same HTTP GET call in Postman, it works correctly, so the endpoint itself seems fine.

  2. Another question is about performance. In QAction_3 I'm retrieving the table row like this:

var row = (DarwindevicesQActionRow)protocol.darwindevices.GetRow(rowKey);

This call is happening in a loop because of row processing by multithreaded timer, so I'm wondering if this might affect performance when many rows are processed.

So my questions are:

  1. Why would protocol.OldRow() return null instead of http response and how the http call is being made by Dataminer?

  2. Is there a more efficient way to retrieve rows instead of calling GetRow() in the loop?

Any suggestions would be really helpful. Thanks!!

Timer:

<Timer id="4" options="ip:2000,1;each:120000;threadPool:10;qactionBefore:4;qactionAfter:5;">
<Name>HTTP Timer</Name>
<Time>10000</Time>
<Interval>0</Interval>
<Content>
<Group>3</Group>
</Content>
</Timer>

Group:

<Group id="3">
<Name>Multi threaded Timer - Periodic Monitoring</Name>
<Description>Multi threaded Timer - Periodic Monitoring</Description>
<Type>poll</Type>
<Content/>
</Group>

QAction:

<QAction id="4" name="Get Darwin Status - Create HTTP Request" encoding="csharp" row="true">
</QAction>
<QAction id="3" name="Periodic Darwin Software Monitoring" encoding="csharp" triggers="3" row="true" options="group" >
</QAction>
<QAction id="5" name="Get Darwin Status - After Timeout" encoding="csharp" row="true">
</QAction>

QActionBefore (QAction_4) - Create Http Request
using System;
using System.Text;
using OMS.Library.DataMiner.Generics;
using Skyline.DataMiner.Scripting;

public class QAction
{
/// <summary>
/// Create HTTP Request
/// </summary>
/// <param name="protocol">Link with SLProtocol process.</param>
/// <returns>HTTP Request</returns>
public static object[] Run(SLProtocol protocol)
{
try
{
var rowKey = protocol.RowKey();
protocol.Log("Row Key: " + rowKey);
var row = (DarwindevicesQActionRow)(object[])protocol.GetRow(Parameter.Darwindevices.tablePid, rowKey);
string baseUrl = row.Darwindeviceurl?.ToString();
string path = "api/system";

string method = "GET";
const int timeout = 10000;
string userName = row.Darwindeviceusername?.ToString();
string password = row.Darwindevicepassword?.ToString();
string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes($"{userName}:{password}"));
string authHeader = $"Authorization|Basic {credentials}";

string requestHeaders = $"Accept|*/*;Accept-Encoding|gzip, deflate, br;Cache-Control|no-cache;{authHeader}";
string[] requestSettings = { method, baseUrl.TrimEnd('/') + "/", userName, password, requestHeaders ,timeout.ToString(),"true" };
string[] resourcePaths = { path };

protocol.SetParameterIndexByKey(Parameter.Darwindevices.tablePid, rowKey, Parameter.Darwindevices.Idx.darwinapistatus_2005 + 1, "running");
protocol.Log("resourcePaths: " + string.Join(", ", resourcePaths));
protocol.Log("requestSettings: " + string.Join(", ", requestSettings));
return new object[] { "http", requestSettings, resourcePaths };
}
catch (Exception ex)
{
Generic.Log(protocol, "Create HTTP Request", ex.Message);
}

return null;
}
}

QAction_3 (Triggered by Group of multithreaded timer - process the response)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Common.Methods;
using Newtonsoft.Json.Linq;
using OMS.Library.DataMiner.Dms;
using OMS.Library.DataMiner.Extensions;
using Skyline.DataMiner.Scripting;
using static Skyline.DataMiner.Scripting.Parameter;

/// <summary>
/// DataMiner QAction Class.
/// </summary>
public class QAction
{
//private static readonly int _batchSize = 10;
/// <summary>
/// The QAction entry point.
/// </summary>
/// <param name="protocol">Link with SLProtocol process.</param>
public void Run(SLProtocolExt protocol)
{

try
{
var rowKey = protocol.RowKey();
var result = protocol.OldRow();

protocol.Log( "key: "+rowKey);
if (result == null)
{
protocol.Log("Result is null.", LogType.Error, LogLevel.NoLogging);
return;
}

string communicationState = Convert.ToString(result);
protocol.Log("Communication state: " + communicationState);

if (communicationState != "TIMEOUT" && communicationState != "NO POLLING OCCURRED" && communicationState != "NO POLLING OCCURED")
{
var responses = (object[])result;
protocol.Log("Received responses: " + responses.ToJson());

if (responses.Length <= 1) return;
var row = (DarwindevicesQActionRow)protocol.darwindevices.GetRow(rowKey); // BETTER WAY OF DOING IT?

var statusLines = (object[])responses[0];
var messageBodies = (object[])responses[1];

for (int i = 0; i < statusLines.Length; i++)
{
string statusLine = Convert.ToString(statusLines[i]);
string response = Convert.ToString(messageBodies[i]);

protocol.Log("Status Line: " + statusLine);

if (statusLine == "HTTP/1.1 200 OK")
{
row.Darwinapistatus_2005 = "200 OK";
}
else
{
row.Darwinapistatus_2005 = "ERROR";
}
}
protocol.darwindevices.SetRow(row);

}

}
catch (Exception e)
{
protocol.Log("QA" + protocol.QActionID + "|Run|An exception occurred: " + e.ToString(), LogType.Error, LogLevel.NoLogging);
}
}
}

 

 

Srimathi Ramachandran [DevOps Member] Selected answer as best 10 hours ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
0
Tom Waterbley [SLC] [DevOps Enabler]9.98K Posted 13 hours ago 5 Comments

Hi Srimathi,

There are a few things to verify.

First, could you confirm the main connection type used by the connector? The type of the connector should be 'http'.

Also, since the username and password are already provided as separate fields in the httpRequestInfo array, it may not be necessary to manually construct the Authorization header. Could you please try sending the request without the Authorization header and let me know if that works?

Srimathi Ramachandran [DevOps Member] Selected answer as best 10 hours ago
Srimathi Ramachandran [DevOps Member] commented 13 hours ago

Hi Tom ,
I changed the connection type from "Virtual" to "HTTP" and removed the authorization headers from the request headers. For testing, I entered a single device URL as the hostname in the element's HTTP connection, and it works.
However, my requirement is to fetch the URLs dynamically from the devices table. Is it possible to configure it so that the URLs are picked up dynamically from the table instead of hardcoding them?

Tom Waterbley [SLC] [DevOps Enabler] commented 12 hours ago

Hi Srimathi. I believe that is what already should be happening when 'baseUrl' starts with 'http://&apos; or 'https://&apos;. That should override the URL that is configured in the element settings.

Srimathi Ramachandran [DevOps Member] commented 12 hours ago

Ah, that makes sense ! so it overrides the base URL with the dynamic ones! I was worried it might always override the element config URL, but that clears it up. Thanks

One more thing I was wondering, is there a better way of doing this? Right now, we’re continuously getting and setting rows in a loop using GetRow and SetRow. Is there a more efficient approach to handle this?

Tom Waterbley [SLC] [DevOps Enabler] commented 11 hours ago

Each row is scheduled individually on a thread pool. DataMiner ensures that all rows are evenly distributed across the specified time interval. Because each row is processed separately, this is currently the most efficient way to work with these multithreaded timers. At the moment, there is no mechanism in place to read or write rows in bulk.

Srimathi Ramachandran [DevOps Member] commented 10 hours ago

Perfect , Thanks 🙂

You are viewing 1 out of 1 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin