Learn More, Pay Less!
Limited Time Offer!

Activities of "liangshiwei"

Hi,

I created an internal issue to discuss, I will let you know if there is any news.

Hi,

Can you share the ProductController class code?

Hi,

Can you explain it in detail? thanks.

Hi,

Can you share a project that can reproduce the problem with me? shiwei.liang@volosoft.com I will check it out. thanks.

Hi,

I'm sorry to say for the current design, it's not possible, Kafka is different from RabbitMQ, it does not have Exchange and routeing keys.

But Kafka consumers can subscribe to multiple topics, you can try this:

[ExposeServices(typeof(KafkaMessageConsumer), typeof(IKafkaMessageConsumer))]
public class MyKafkaMessageConsumer : KafkaMessageConsumer
{
    private static readonly PropertyInfo ConsumerProperty;

    static MyKafkaMessageConsumer()
    {
        var type = typeof(KafkaMessageConsumer);
        ConsumerProperty = type.GetProperty("Consumer", BindingFlags.Instance | BindingFlags.NonPublic);
    }

    public MyKafkaMessageConsumer(IConsumerPool consumerPool, IExceptionNotifier exceptionNotifier,
        IOptions<AbpKafkaOptions> options, IProducerPool producerPool, AbpAsyncTimer timer) : base(consumerPool,
        exceptionNotifier, options, producerPool, timer)
    {
    }

    protected override void Consume()
    {
        ConsumerProperty.SetValue(this, ConsumerPool.Get(GroupId, ConnectionName));

        Task.Factory.StartNew(async () =>
        {
            Consumer.Subscribe(new []{ "MyTopicName", "MyTopicName2",.....});

            while (true)
            {
                try
                {
                    var consumeResult = Consumer.Consume();

                    if (consumeResult.IsPartitionEOF)
                    {
                        continue;
                    }

                    await HandleIncomingMessage(consumeResult);
                }
                catch (ConsumeException ex)
                {
                    Logger.LogException(ex, LogLevel.Warning);
                    await ExceptionNotifier.NotifyAsync(ex, logLevel: LogLevel.Warning);
                }
            }
        }, TaskCreationOptions.LongRunning);
    }
}

Hi,

Can you explain it in detail? thanks.

For now, you can try this:

Add to your *.ApplicationAutoMapperProfile

CreateMap<ApiResourceSecret, ApiResourceSecretDto>()
    .ForMember(d => d.Value, x => x.MapFrom(_ => _.Value));

CreateMap<ClientSecret, ClientSecretDto>()
    .ForMember(d => d.Value, x => x.MapFrom(_ => _.Value));

Hi,

The IdentityServerCacheItemInvalidator is a local event handler class, so I think RabbitMQ will not affect it.

To reproduce, you can create a new client in Administration > Identity Server > Clients, add a Secret. Save the client and then add another Secret and delete the previous. When you try to save, it will show the error.

I could reproduce the problem, we will fix it in the patch version, your ticket has been refunded.

We will fix it in the patch version, your ticket has been refunded.

See: https://github.com/abpframework/abp/issues/13285

Hi,

After the deep check, it's really a problem, only working the first time.

You can try this:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using IdentityServer4.Configuration;
using IdentityServer4.Models;
using IdentityServer4.Stores;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Options;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.IdentityServer;
using Volo.Abp.IdentityServer.ApiResources;
using Volo.Abp.IdentityServer.ApiScopes;
using Volo.Abp.IdentityServer.IdentityResources;
using Volo.Abp.ObjectMapping;
using ApiResource = Volo.Abp.IdentityServer.ApiResources.ApiResource;
using ApiScope = Volo.Abp.IdentityServer.ApiScopes.ApiScope;
using IdentityResource = Volo.Abp.IdentityServer.IdentityResources.IdentityResource;

namespace Qa.Data;

[ExposeServices(typeof(ResourceStore), typeof(IResourceStore))]
public class MyResourceStore : ResourceStore
{
    public MyResourceStore(IIdentityResourceRepository identityResourceRepository,
        IObjectMapper<AbpIdentityServerDomainModule> objectMapper, IApiResourceRepository apiResourceRepository,
        IApiScopeRepository apiScopeRepository,
        IDistributedCache<IdentityServer4.Models.IdentityResource> identityResourceCache,
        IDistributedCache<IdentityServer4.Models.ApiScope> apiScopeCache,
        IDistributedCache<IdentityServer4.Models.ApiResource> apiResourceCache,
        IDistributedCache<Resources> resourcesCache, IOptions<IdentityServerOptions> options) : base(
        identityResourceRepository, objectMapper, apiResourceRepository, apiScopeRepository, identityResourceCache,
        apiScopeCache, apiResourceCache, resourcesCache, options)
    {
    }

    protected override async Task<IEnumerable<TModel>> GetCacheItemsAsync<TEntity, TModel>(
        IDistributedCache<TModel> cache, IEnumerable<string> keys, Func<string[], Task<List<TEntity>>> entityFactory,
        Func<List<TModel>, string, List<IEnumerable<KeyValuePair<string, TModel>>>> cacheItemsFactory,
        string cacheKeyPrefix = null)
    {
        var result = await base.GetCacheItemsAsync(cache, keys, entityFactory, cacheItemsFactory,
                cacheKeyPrefix);
      
        if (result is IEnumerable<IdentityServer4.Models.ApiResource> apiResources)
        {
            return (IEnumerable<TModel>) apiResources.DistinctBy(x => x.Name);
        }

        return result;
    }
}

Add your *.EntityFrameworkCore module

    public override void PreConfigureServices(ServiceConfigurationContext context)
    {
        QaEfCoreEntityExtensionMappings.Configure();
        
        PreConfigure<IIdentityServerBuilder>(builder =>
        {
            builder.AddResourceStore<MyResourceStore>();
        });
        
    }
Showing 4751 to 4760 of 6574 entries
Made with ❤️ on ABP v9.2.0-preview. Updated on February 17, 2025, 05:40