コード例 #1
0
 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));
 }
コード例 #2
0
 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;
     }));
 }