Claus Ibsen created CAMEL-27307:
-----------------------------------

             Summary: camel-aws2-cw - putMetricData with an empty collection or 
array body should fail with a clear message
                 Key: CAMEL-27307
                 URL: https://issues.apache.org/jira/browse/CAMEL-27307
             Project: Camel
          Issue Type: Improvement
          Components: camel-aws2
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Since the producer accepts a {{MetricDatum}}, a collection or an array of them 
as the body ({{Cw2Producer.getMetricData}} / {{toMetricData}}), an empty 
collection or array gives an empty {{metricData}} list, and the producer calls 
{{putMetricData}} with it.

Against the Floci CloudWatch emulator the call succeeds and nothing is sent, so 
the message passes as if a data point was put. What real AWS CloudWatch does 
with an empty {{MetricData}} was not checked; the API documents {{MetricData}} 
as required.

Found while documenting the {{aws-cloudwatch-sink}} Kamelet 
(apache/camel-kamelets#3310).

Expected: an empty collection or array fails the exchange with a clear message 
from the producer (such as "The body is an empty collection: there is no 
MetricDatum to put"), rather than depending on the service.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to