9
9
using Microsoft . Azure . WebJobs . Host . Protocols ;
10
10
using Microsoft . Azure . WebJobs . Host . Triggers ;
11
11
using Microsoft . Extensions . Logging ;
12
- using Microsoft . Extensions . Options ;
13
12
using RabbitMQ . Client ;
14
13
using RabbitMQ . Client . Events ;
15
14
@@ -19,19 +18,19 @@ internal class RabbitMQTriggerBinding : ITriggerBinding
19
18
{
20
19
private readonly IRabbitMQService _service ;
21
20
private readonly ILogger _logger ;
22
- private readonly IOptions < RabbitMQOptions > _options ;
23
21
private readonly Type _parameterType ;
24
22
private readonly string _queueName ;
25
23
private readonly string _hostName ;
24
+ private readonly ushort _prefetchCount ;
26
25
27
- public RabbitMQTriggerBinding ( IRabbitMQService service , string hostname , string queueName , ILogger logger , Type parameterType , IOptions < RabbitMQOptions > options )
26
+ public RabbitMQTriggerBinding ( IRabbitMQService service , string hostname , string queueName , ILogger logger , Type parameterType , ushort prefetchCount )
28
27
{
29
28
_service = service ;
30
29
_queueName = queueName ;
31
30
_hostName = hostname ;
32
31
_logger = logger ;
33
32
_parameterType = parameterType ;
34
- _options = options ;
33
+ _prefetchCount = prefetchCount ;
35
34
BindingDataContract = CreateBindingDataContract ( ) ;
36
35
}
37
36
@@ -60,7 +59,7 @@ public Task<IListener> CreateListenerAsync(ListenerFactoryContext context)
60
59
throw new ArgumentNullException ( "context" ) ;
61
60
}
62
61
63
- return Task . FromResult < IListener > ( new RabbitMQListener ( context . Executor , _service , _queueName , _logger , context . Descriptor , _options . Value . PrefetchCount ) ) ;
62
+ return Task . FromResult < IListener > ( new RabbitMQListener ( context . Executor , _service , _queueName , _logger , context . Descriptor , _prefetchCount ) ) ;
64
63
}
65
64
66
65
public ParameterDescriptor ToParameterDescriptor ( )
0 commit comments