0
我想將EventHubTrigger與自定義ConsumerGroup一起使用。使用EventHubTrigger配置自定義ConsumerGroup
的代碼看起來像這樣使用默認ConsumerGroup時:
public static async Task ProcessQueueMessage([EventHubTrigger("%EventHubName%")] TelemetryEvent[] messages, TextWriter log)
{}
的EventHubTriggerAttribute
類有哪些可以設置一個ConsumerGroup屬性。但是如何?
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class EventHubTriggerAttribute : Attribute
{
//
// Summary:
// Create an instance of this attribute.
//
// Parameters:
// eventHubName:
// Event hub to listen on for messages.
public EventHubTriggerAttribute(string eventHubName);
//
// Summary:
// Name of the event hub.
public string EventHubName { get; }
//
// Summary:
// Optional Name of the consumer group. If missing, then use the default name, "$Default"
public string ConsumerGroup { get; set; }
}