| | 1 | | using System.Linq; |
| | 2 | | using Microsoft.Extensions.DependencyInjection; |
| | 3 | | using SeungYongShim.Kafka; |
| | 4 | |
|
| | 5 | |
|
| | 6 | | namespace Microsoft.Extensions.Hosting |
| | 7 | | { |
| | 8 | | public static class UseKafkaExtension |
| | 9 | | { |
| | 10 | | public static IHostBuilder UseKafka(this IHostBuilder host, |
| | 11 | | KafkaConfig kafkaConfig, |
| | 12 | | params string[] searchPatterns) |
| 2 | 13 | | { |
| 2 | 14 | | host.ConfigureServices((host, services) => |
| 4 | 15 | | { |
| 4 | 16 | | services.AddKafka(kafkaConfig, searchPatterns.Append("SeungYongShim.Kafka*.dll")); |
| 4 | 17 | | }); |
| | 18 | |
|
| 2 | 19 | | return host; |
| 2 | 20 | | } |
| | 21 | | } |
| | 22 | | } |