gokgokalp / metrobus Goto Github PK
View Code? Open in Web Editor NEWLightweight messaging wrapper of MassTransit
License: MIT License
Lightweight messaging wrapper of MassTransit
License: MIT License
Hocam selam,
Metrobus , UseMessageSchedulerWithQuartz methodunı nasıl kullanıp ayarlanıyor?
methodun aldığı parametreye göre ;
services.AddMetroBus(x => x.AddConsumer<WorkerConsumer>());
services.AddSingleton(provider => MetroBusInitializer.Instance
.UseRabbitMq(mqConstant.RabbitMQUri, mqConstant.RabbitMQUserName, mqConstant.RabbitMQPassword)
.RegisterConsumer<WorkerConsumer>("ilan.schedule.queue", provider)
.UseMessageSchedulerWithQuartz("rabbitmq://localhost/quartz")
.SetPrefetchCount(16)
.UseRateLimiter(20, TimeSpan.FromMinutes(10.0))
.Build())
.BuildServiceProvider();
services.AddHostedService<BusService>();
biçimde ayarladım
consumer ;
public class WorkerConsumer : IConsumer<WorkerCommand>
{
private readonly ILogger<WorkerConsumer> Logger;
readonly Uri NotificationService;
public WorkerConsumer(ILogger<WorkerConsumer> logger)
{
Logger = logger;
NotificationService = new Uri("rabbitmq://localhost/notification.queue");
}
public Task Consume(ConsumeContext<WorkerCommand> context)
{
var IlanId = context.Message.IlanId;
var EstimateDate = context.Message.EstimateDate;
context.ScheduleSend(NotificationService, EstimateDate, new NotifyCommand
{
IlanId = IlanId
});
return Task.CompletedTask;
}
}
}
çalıştırdıktan sonra estime tarihinde işlem yapmıyor.
Selam,
.Net Core 3.1'a upgrade yaptığımda aşağıdaki exceptionı alıyorum ;
System.TypeLoadException: Method 'RegisterExecuteActivity' on type 'MassTransit.ExtensionsDependencyInjectionIntegration.Configuration.Registration.DependencyInjectionContainerR
egistrar' from assembly 'MassTransit.ExtensionsDependencyInjectionIntegration, Version=5.5.2.0, Culture=neutral, PublicKeyToken=b8e0e9f2f1e657fa' tried to implicitly implement a
n interface method with weaker type parameter constraints.
at MassTransit.ExtensionsDependencyInjectionIntegration.Configuration.Registration.ServiceCollectionConfigurator..ctor(IServiceCollection collection)
at MassTransit.DependencyInjectionRegistrationExtensions.AddMassTransit(IServiceCollection collection, Action`1 configure)
at MetroBus.Microsoft.Extensions.DependencyInjection.MetroBusExtensions.AddMetroBus(IServiceCollection serviceCollection, Action`1 configure)
at ilan.BusConfig.UseBusService(IServiceCollection services, MqConstant mqConstant) in D:\Projects\x\ilan\BusConfig.cs:line 15
at ilan.Startup.ConfigureServices(IServiceCollection services) in D:\Projects\x\ilan\Startup.cs:line 64
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.InvokeCore(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass9_0.<Invoke>g__Startup|0(IServiceCollection serviceCollection)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.Invoke(Object instance, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.ConfigureServicesBuilder.<>c__DisplayClass8_0.<Build>b__0(IServiceCollection services)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.UseStartup(Type startupType, HostBuilderContext context, IServiceCollection services)
at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass12_0.<UseStartup>b__0(HostBuilderContext context, IServiceCollection services)
at Microsoft.Extensions.Hosting.HostBuilder.CreateServiceProvider()
at Microsoft.Extensions.Hosting.HostBuilder.Build()
at ilan.Program.Main(String[] args) in D:\Projects\x\x\Program.cs:line 32
Problem;
public class BusService : IHostedService
{
private readonly IBusControl BusControl;
public BusService(IBusControl busControl)
{
BusControl = busControl;
}
public Task StartAsync(CancellationToken cancellationToken)
{
return BusControl.StartAsync(cancellationToken);
}
public Task StopAsync(CancellationToken cancellationToken)
{
return BusControl.StopAsync(cancellationToken);
}
IBusControl'ı inject yaparken oluyor.
Merhaba , geliştirmiş olduğunuz tool için dökuman var mı?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.