--
I have a class publishing messages to be scheduled based on client's preferred poll times to extract their data. My scheduler class doesn't receive every message, many end up in the skipped_queue. The amount of messages received varies. Here is a sample of the code:
public async Task Consume(ConsumeContext<IUnitScheduled> context)
{
try
{
await context.ScheduleSend(new Uri(ConfigurationManager.AppSettings["PollingMQ"] + "/polling_service"),
DateTime.Today.Add(context.Message.PollScheduleTime),
new StartPollingMessage
{
PollUnitID = context.Message.PollUnitID,
PollUnitPOS = context.Message.PollUnitPOS,
PollScheduleTime = context.Message.PollScheduleTime,
CorrelationId = context.Message.CorrelationId
});
}
catch (Exception ex)
{
var debug = "";
}
}
private static void ConfigureBus()
{
_busControl = Bus.Factory.CreateUsingRabbitMq(bc =>
{
var host = bc.Host(new Uri(ConfigurationManager.AppSettings["PollingMQ"]), h =>
{
h.Username(ConfigurationManager.AppSettings["PollingUserName"]);
h.Password(ConfigurationManager.AppSettings["PollingPassword"]);
});
//need to install Quartz as a service for this to work
//bc.UseMessageScheduler(new Uri(ConfigurationManager.AppSettings["PollingScheduler"]));
//use in-mem for now. This is volatile and messages will be lost if the process is ended.
bc.UseInMemoryScheduler();
bc.ReceiveEndpoint(host, "polling_service", ep =>
{
//ep.PrefetchCount = 1; //How many message will be pulled at once.
ep.Consumer<PollingScheduler>();
});
});
}
I've tried setting prefetch count and removing it, but no effect. I suppose I could run more than one instance of the scheduler, but I'd prefer to have this one class act appropriately.
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/ab1e5dc1-71bc-420d-909e-ff91b50d6603%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.