Author Topic: XML-RPC Realtime calls with multiple queues missing data  (Read 3702 times)

WRP

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 1
    • View Profile
XML-RPC Realtime calls with multiple queues missing data
« on: December 01, 2011, 06:58:10 »
I am trying to grab data from RTAgentsLoggedIn and RTRiassunto for multiple queues. The problem I'm having is that some of the data for some queues seems to be missing in the response when I make the request for multiple queues at once.

For example, If I make a request with the queue value set to "100", I'll get a full listing of all members in that queue as well as an entry in RTRiassunto with all of the info that is to be expected. If I then make a request for "101", I will get another full, complete block of data.

If I make a request for "100|101", I will not get the same data set back. I'll instead see (in this particular case) only the member listings for 100, and only the RTRiassunto data for 100 as well. I've tried this with a combination of different queues, and it seems to have something to do with the queues themselves. The same queues will always "disappear" in the response when combined. For instance "100|101|102|103" might show 100 and 103, but 101 will again be gone, as will 102.

I've tested this against my script, as well as against a script I found on this forum, which I've provided below. Any help is greatly appreciated!!

Code: [Select]
<?php
    
require_once 'XML/RPC.php';
    
    
$qm_server "yourmachine"// the QueueMetrics server address
    
$qm_port "8080"// the port QueueMetrics is running on
    
$qm_webapp "queuemetrics"// the webapp name for QueueMetrics
    
    // set which response blocks we are looking for
    
$req_blocks = new XML_RPC_Value(array(
        new 
XML_RPC_Value("RealtimeDO.RTRiassunto"),
        new 
XML_RPC_Value("RealtimeDO.RTCallsBeingProc"),
        new 
XML_RPC_Value("RealtimeDO.RTAgentsLoggedIn")
        ), 
"array");
        
    
// general invocation parameters - see the documentation
    
$params = array(
        new 
XML_RPC_Value("200|300"),
        new 
XML_RPC_Value("robot"),
        new 
XML_RPC_Value("robot"),
        new 
XML_RPC_Value(""),
        new 
XML_RPC_Value(""),
        
$req_blocks
        
);
        
    
$msg = new XML_RPC_Message('QM.realtime'$params);
    
$cli = new XML_RPC_Client("/$qm_webapp/xmlrpc.do"$qm_server$qm_port);
    
    
//$cli->setDebug(1);
    
$resp $cli->send($msg);
    
    if (!
$resp) {
        echo 
'Communication error: ' $cli->errstr;
        exit;
    }
    
    if (
$resp->faultCode()) {
        echo 
'Fault Code: ' $resp->faultCode() . "\n";
        echo 
'Fault Reason: ' $resp->faultString() . "\n";
    } else {
        
$val $resp->value();
        
$blocks XML_RPC_decode($val);

        
// now we print out the details....
        
printBlock"result"$blocks );
        
printBlock"RealtimeDO.RTRiassunto"$blocks );
        
printBlock"RealtimeDO.RTCallsBeingProc"$blocks );
        
printBlock"RealtimeDO.RTAgentsLoggedIn"$blocks );
    }
    
    
// output a response block as HTML
    
function printBlock$blockname$blocks ) {
        echo 
"Response block: $blockname \n";
        
$block $blocks[$blockname];
        
        for ( 
$r 0$r sizeof$block ); $r++ ) {
            echo 
"\n";
            for ( 
$c 0$c sizeof$block[$r] ); $c++ ) {
                echo( 
$block[$r][$c] . "\t" );
            }
        }
    }
?>

WRP

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 1
    • View Profile
Re: XML-RPC Realtime calls with multiple queues missing data
« Reply #1 on: December 01, 2011, 07:10:39 »
Something else I'm noticing is that for the "trouble queues", when they are polled individually, the RTR response only includes the "all selected" result, not the particular queue result. Queues that aren't having issues will show the "all selected" result as well as a row of data for the particular queue.

WRP

  • Jr. Member
  • **
  • Posts: 57
  • Karma: 1
    • View Profile
Re: XML-RPC Realtime calls with multiple queues missing data
« Reply #2 on: January 06, 2012, 20:06:45 »
Have you had a chance to look into this yet? This issue is causing additional load on our servers.

Thanks!

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: XML-RPC Realtime calls with multiple queues missing data
« Reply #3 on: January 18, 2012, 18:27:20 »
Queues will appear in some blocks only if they have data, if they are all zeroed out, they don't (like for the realtime page - the logic is the same).