fixed errors in EventService
- Initialized boost::circular_buffer_space_optimized<std::string> which
was not initialized. It prevented any event from being send.
- Removed line 'parser->skip(true)' which cause all received responses
to be interpreted as errors. It was triggering retry which resulted in
sensing same event multiple times.
Tested:
POST redfish/v1/EventService/Subscriptions, body:
{
"Destination": "https://127.0.0.1:4042/",
"Protocol": "Redfish",
"EventFormatType": "MetricReport"
}
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The resource has been created successfully",
"MessageArgs": [],
"MessageId": "Base.1.8.1.Created",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
POST redfish/v1/TelemetryService/MetricReportDefinitions, body:
{
"Id": "TestReport",
"Metrics": [
{
"MetricId": "TestMetric",
"MetricProperties": [
"/redfish/v1/Chassis/chassis/Thermal#/Temperatures/7/ReadingCelsius"
]
}
],
"MetricReportDefinitionType": "OnRequest",
"ReportActions": [
"RedfishEvent",
"LogToMetricReportsCollection"
]
}
{
"@Message.ExtendedInfo": [
{
"@odata.type": "#Message.v1_1_1.Message",
"Message": "The resource has been created successfully",
"MessageArgs": [],
"MessageId": "Base.1.8.1.Created",
"MessageSeverity": "OK",
"Resolution": "None"
}
]
}
GET redfish/v1/TelemetryService/MetricReports/TestReport
{
"@odata.id": "/redfish/v1/TelemetryService/MetricReports/TestReport",
"@odata.type": "#MetricReport.v1_3_0.MetricReport",
"Id": "TestReport",
"MetricReportDefinition": {
"@odata.id": "/redfish/v1/TelemetryService/MetricReportDefinitions/TestReport"
},
"MetricValues": [
{
"MetricId": "TestMetric",
"MetricProperty": "/redfish/v1/Chassis/chassis/Thermal#/Temperatures/7/ReadingCelsius",
"MetricValue": "-8388608000.000000",
"Timestamp": "1970-04-12T02:28:53+00:00"
}
],
"Name": "TestReport",
"Timestamp": "1970-04-12T06:08:17+00:00"
}
EVENT RECEIVED
{
"@odata.id": "/redfish/v1/TelemetryService/MetricReports/TestReport",
"@odata.type": "#MetricReport.v1_3_0.MetricReport",
"Id": "TestReport",
"MetricReportDefinition": {
"@odata.id": "/redfish/v1/TelemetryService/MetricReportDefinitions/TestReport"
},
"MetricValues": [
{
"MetricId": "TestMetric",
"MetricProperty": "/redfish/v1/Chassis/chassis/Thermal#/Temperatures/7/ReadingCelsius",
"MetricValue": "-8388608000.000000",
"Timestamp": "1970-04-12T02:28:53+00:00"
}
],
"Name": "TestReport",
"Timestamp": "1970-04-12T06:08:17+00:00"
}
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I4912853c3b59593e7032424d0b48aca7a36889b3
diff --git a/http/http_client.hpp b/http/http_client.hpp
index 0c9e387..7fd2041 100644
--- a/http/http_client.hpp
+++ b/http/http_client.hpp
@@ -68,7 +68,8 @@
std::optional<
boost::beast::http::response_parser<boost::beast::http::string_body>>
parser;
- boost::circular_buffer_space_optimized<std::string> requestDataQueue{};
+ boost::circular_buffer_space_optimized<std::string> requestDataQueue{
+ maxRequestQueueSize};
ConnState state = ConnState::initialized;
@@ -168,9 +169,6 @@
parser.emplace(std::piecewise_construct, std::make_tuple());
parser->body_limit(httpReadBodyLimit);
- // Check only for the response header
- parser->skip(true);
-
// Receive the HTTP response
boost::beast::http::async_read(
conn, buffer, *parser,