public static Task Telemetry( [EventHubTrigger("telemetry", ConsumerGroup = "%telemetry-source-consumergroup%", Connection = "telemetry-source-connection")] EventData[] input, [EventHub("telemetry-copy", Connection = "telemetry-target-connection")] EventHubClient outputClient, ILogger log) { return(EventHubReplicationTasks.ForwardToEventHub(input, outputClient, log)); }
public static Task TelemetryRight( [EventHubTrigger(rightEventHubName, ConsumerGroup = rightEventHubConsumerGroup, Connection = rightEventHubConnection)] EventData[] input, [EventHub(leftEventHubName, Connection = leftEventHubConnection)] EventHubClient outputClient, ILogger log) { return(EventHubReplicationTasks.ConditionalForwardToEventHub(input, outputClient, log, (inputEvent) => { if (!inputEvent.Properties.ContainsKey("repl-target") || !string.Equals(inputEvent.Properties["repl-target"] as string, rightEventHubName)) { inputEvent.Properties["repl-target"] = leftEventHubName; return inputEvent; } return null; })); }