CLIENT_SYSTEM, // back-door the meta-data checks // this is a meta-record so this request will go to the admin service META_TEMPLATE => TEMPLATE_CLASS_WAREHOUSE, // choose a template that's not local to appServer // this template is for a warehouse record so the request will go to segundo service META_TEMPLATE => TEMPLATE_CLASS_WHC1_PROD_REG, META_CLIENT_IP => STRING_SESSION_HOME, // required META_EVENT_GUID => guid() // simulate a broker event by generating the event guid ]; // warehouse meta data (admin) $data = [ STRING_QUERY_DATA => [ DB_TOKEN => [OPERAND_NULL => [OPERATOR_EQ => ['96811337-85F1-A274-8557-F8312B757D74']]]] ]; // warehouse actual data (segundo) $data = [ STRING_QUERY_DATA => [ DB_WH_TOKEN => [OPERAND_NULL => [OPERATOR_EQ => ['8C87E8E9-33E4-42A6-59FA-741711453DFF']]]] ]; // This request event is only available in the namaste (appServer) read broker. However, the data (template) defines // the segundo service...which has an event called BROKER_REQUEST_REMOTE_FETCH. This event will be called, on behalf // of the client, by the read-broker... $request = BROKER_REQUEST_FETCH; $request = [ BROKER_REQUEST => $request, BROKER_DATA => $data, BROKER_META_DATA => $meta ]; $payload = gzcompress(json_encode($request)); $brokerClient = new gacBrokerClient(BROKER_QUEUE_R, __METHOD__ . AT . __LINE__); if (!$brokerClient->status) { consoleLog($res, CON_ERROR, ERROR_BROKER_CLIENT_DECLARE . BROKER_QUEUE_R); } else { $response = $brokerClient->call($payload); $response = json_decode(gzuncompress($response), true); var_export($response); } if (is_object($brokerClient)) $brokerClient->__destruct(); unset($brokerClient); echo $eos . 'Program ends...' . $eos;