Okey, I will give you a usable example
Hi,
abp vnext is different from the cache design of aspnetboilerplate, it continues the distributed cache design of aspnet core. currently there is no feature to cache groups
Hi,
Please see https://docs.abp.io/en/abp/latest/Object-Extensions
Hi, you can custom the code if you need.
public class MyJobFilterAttribute : JobFilterAttribute, IElectStateFilter
{
public void OnStateElection(ElectStateContext context)
{
if (context.CandidateState is EnqueuedState enqueuedState)
{
// you can custom if iyou need.
enqueuedState.Queue = "myqueue";
}
}
}
The filter will work on global. you don't need add attribute to method.
You need add the Volo.Saas.Host.Application
to your project and add SaasHostApplicationModule
to your module dependencies
.web
project.<ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Public.Web\Volo.Abp.Account.Pro.Public.Web.csproj" />
<ProjectReference Include="..\..\modules\Volo.Account.Pro\src\Volo.Abp.Account.Pro.Public.Web.IdentityServer\Volo.Abp.Account.Pro.Public.Web.IdentityServer.csproj" />
SampleAppMenuContributor
classpublic async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
//await ConfigureMainMenu(context);
var moduleMenu = AddModuleMenuItem(context);
await AddMenuItemTblTests(context, moduleMenu);
}
}
Hi,
Question 1: Could you share the project to me? shiwei.liang@volosoft.com
Question 2: Please show the menu contributors code of the module
Question 3: This is not a problem, settings need to navigate to the authorization server
Hi,
First , create a filter:
public class MyJobFilterAttribute : JobFilterAttribute, IElectStateFilter
{
public void OnStateElection(ElectStateContext context)
{
if (context.CandidateState is EnqueuedState enqueuedState)
{
enqueuedState.Queue = "myqueue";
}
}
}
Add the following configuration to your module:
Configure<AbpHangfireOptions>(options =>
{
options.ServerOptions = new BackgroundJobServerOptions()
{
Queues = new[] {"default", "myqueue"}
};
});
context.Services.AddHangfire(options =>
{
//options.UseMemoryStorage();
options.UseFilter(new MyJobFilterAttribute());
});
Now, your all job will enqueue to the myqueue
queue and you can custom if you need.