Skip to content

Instantly share code, notes, and snippets.

@gkinsman
Last active February 6, 2019 16:47
Show Gist options
  • Save gkinsman/58463acce161a492f89f176951157d3e to your computer and use it in GitHub Desktop.
Save gkinsman/58463acce161a492f89f176951157d3e to your computer and use it in GitHub Desktop.
MT Preftech
var busControl = Bus.Factory.CreateUsingRabbitMq(cfg => {
cfg.UseLog4Net();
cfg.UseApplicationInsights(_telemetryClient);
cfg.PrefetchCount = (ushort)_settings.MessageBusPrefetchCount; // 10 in our config
host = cfg.Host("rabbitcluster", config.VHost, h => {
h.UseCluster(c => prioritisedHostNames.ForEach(c.Node));
h.Username(_shardConfigProvider.Username);
h.Password(_shardConfigProvider.Password);
h.PublisherConfirmation = _publisherConfirms;
});
if (!string.IsNullOrEmpty(queueName)) {
var tempQueueName = CreateTemporaryQueueName(queueName, out id);
cfg.OverrideDefaultBusEndpointQueueName(tempQueueName);
}
if (_deployOnly) cfg.DeployTopologyOnly = true;
});
_connectFunc = host =>
host.ConnectReceiveEndpoint(_queue,
c =>
{
// both endpointConfigurator and consumerConfigurator are null for this test
endpointConfigurator?.Invoke(c);
c.Consumer(Peregrine.Core.Ninject.Kernel, consumerConfigurator);
});
@phatboyg
Copy link

phatboyg commented Feb 6, 2019

You aren't setting the PrefetchCount for the receive endpoint, only the bus endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment