3

Problem / Background

For logging every request and response out of API Management, I use a log-to-eventhub policy. My goal is to assure that all logged data of every single request / response is transmitted to Event Hubs.

Example Code for log-to-eventhuv-policy

<policies>
    <inbound>
        <set-variable name="test1" value="1" />
        <log-to-eventhub logger-id="CslLog" partition-id="0">@{
            return new JObject(
                new JProperty("test1", context.Variables["test1"])
            ).ToString();
        }</log-to-eventhub>
        <base />
    </inbound>

Unfortunately I could not find any documentation about the reliability of the log-to-eventhub policy.

Goals / Questions

  1. In Case the log-to-eventhub policy can not reach the Event Hub for whatever reasons, a reconnection should be tried.
  2. If the transmission of logged data of the requests/responses to Event Hubs finally failed, these requests should throw an error.

So far I haven´t found any solution to assure the reliability of transmission of data logged with my log-to-eventhub policy.

Looking forward for your responses.

Hawky
  • 31
  • 3
  • I have the same issue. One of the main benefits touted for messages is guaranteed delivery. But there doesn't appear to be any way for API Management to detect that a message failed to be make it to the Event Hub when you use the recommended log-to-eventhub policy. – Ivan Wilson Jan 14 '21 at 07:13

0 Answers0