Base solution for your next web application

Activities of "gunpal5"

Hello,

I have a static class in my codes. I need to resolve a dependency using IocManager.Instance. but it doesn't seem to be resolving the dependency. It seems this instance is not the same as the application IocManager.

Is there any suggestion for the workaround?

public static class TradeFactory
    {
        private static ITradeIdGenerator TradeIdGenerator
        {
            get
            {
                return IocManager.Instance.Resolve<ITradeIdGenerator>();
            }
        }

        public static Trade GenerateTrade(string currencyPair, Price executionPrice, Volume executedQuantity,Order matchedOrder, Order inboundOrder)
        {
            Trade trade=new Trade(TradeIdGenerator.GenerateTradeId(),currencyPair, executionPrice, executedQuantity, DateTime.Now,
            matchedOrder, inboundOrder);
            return trade;
        }
    }

Regards, Gunpal Jain

Question

Hello,

How to register Scoped dependencies? I can't find a way to do it with ABP framework. It only supports Singleton or Transient. Is there any simple way of defining Scoped dependencies?

Regards, Gunpal Jain

Hello,

I am facing a strange issue.I am using Pomelo.EntityFrameworkCore.MySql connector for my app. Its a single tenant app.

Scenario 1 (Host without debugging): When I run the application host without debugging, the login page loads fine but when i enter the admin username and password. it sticks to loading page and pops up an error message after few minutes (see screenshots).

On network tab on chrome's dev tools, It looks like it is waiting for <a class="postlink" href="http://localhost:22742/AbpUserConfiguration/GetAll">http://localhost:22742/AbpUserConfiguration/GetAll</a>. which never returns any value and after few minutes the request is getting timeout.

but if I try to load directly on browser <a class="postlink" href="http://localhost:22742/AbpUserConfiguration/GetAll">http://localhost:22742/AbpUserConfiguration/GetAll</a>, it loads fine without any issue.

Scenario 2 (Host with debugger attached): When I run the host in debugging mode. The app is running without any issue.

After I run the application in debugging mode and load the frontend on browser it loads fine. after loading the frontend for few times. if I stop the debugging session on host and run the host again without debugging. then again it loads fine. I believe it's due to caching of some configuration.

Is there any explanation for this? any suggestion to fix the issue?

Regards, Gunpal Jain

Screenshots:

Hello,

I am not an expert in distributed systems, I am trying to figure out a solution for my problem.

I have three separate application domains for my web app, I want to deploy them to three different servers. I need these servers to communicate each other and notify on various events. for example:

Let say a user submits a form on web browser. it will go to my application service server, this server would need to call a backend service on my other server (say server 2). now server 2 will perform some task and will call back the server 1 and also notify the server 3 (server 3 would be sending email and sms notifications for the performed task).

  1. So, my question is how can I forward the authentication token from application service on server 1 to server 2.
[AbpAuthorize]
public async Task<MyOutputDto> ForwardItToServer2(MyInputDto input)
        {           
            //Forward This to Server 2
            myServer2Client.Call(input);
        }

I don't want to pass user id or any user identifier while calling to server 2. I need server 2 to identify user id by the token or cookies.

  1. my server 2 is handling background jobs. So, how can I forward signalr notifications from server 2 to web browser via server 1? i.e. server 2 would notify server 1 then it will be forwarded to web browser.

I don't want to use callback urls on server 1. I want to make it work with some realtime bus like signalr. I can't directly connect the frontend to server 2 either.

Is there any solution for this? Or Am I going in wrong direction with this approach? I am feeling like I am missing something basic.

I hope i am clear about my problem.

Regards, Gunpal Jain

Question

Hello,

I have few questions:

  1. I need to code my application services in different module than provided with startup project. So, can I call CreateControllersForAppServices function multiple times for different application modules to create controllers for my application services, like this:
Configuration.Modules.AbpAspNetCore()
                .CreateControllersForAppServices(
                    typeof(MyApplicationModule).GetAssembly()
                );
 Configuration.Modules.AbpAspNetCore()
                .CreateControllersForAppServices(
                    typeof(MyApplicationModule2).GetAssembly()
                );
Configuration.Modules.AbpAspNetCore()
                .CreateControllersForAppServices(
                    typeof(MyApplicationModule3).GetAssembly()
                );
  1. Can I create my application services with open source abp boilerplate and integrate them to aspnetzero api project?

What I am trying to do here is create 3 different domains for my application which will handle different concerns for my application.

Thanks, Gunpal Jain

Question

Hello,

I was comparing ABP Core template with Asp.net core in terms of throughput and efficiency. I need to make a highly efficient web service which would be inserting like 1 million blog posts in 1 second.

Would having ABP stack be a overhead or it is negligible? Is there any load test and stress test data available for ABP core?

Regards, Gunpal Jain

Hello,

I want to login users with their email ID on a specific scenario i.e. on a successful payment. all the password on the system are hashed. Is there anyway to login with only Email ID?

I tried to look into the login codes there are so much of codes. what are the specific functions/methods needs to be called for successful login?

Regards, Gunpal Jain

Hello,

I want to modify some properties of my DTOs before it gets serialized.

e.g. I have a FileDto which has a property for virtual path (e.g. "~/storage/myfile.jpg") of stored file on disk. I want to convert it to an absolute Uri (like "http://mydomain/storage/myfile.jpg") before the instances of FileDtos get serialized.

Is there any interface or something to modify the DTOs before serialization?

Regards, Gunpal Jain

Hello,

I am trying to setup Hangfire on my production environment. I have setup it according to this article: <a class="postlink" href="http://docs.hangfire.io/en/latest/deployment-to-production/making-aspnet-app-always-running.html">http://docs.hangfire.io/en/latest/deplo ... nning.html</a>

but i am getting this issue.

Failed An exception occurred during processing of a background job. 


System.MissingMethodException

No parameterless constructor defined for this object.
System.MissingMethodException: No parameterless constructor defined for this object.
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at Hangfire.JobActivator.SimpleJobActivatorScope.Resolve(Type type)
   at Hangfire.Server.CoreBackgroundJobPerformer.Perform(PerformContext context)
   at Hangfire.Server.BackgroundJobPerformer.<>c__DisplayClass8_0.<PerformJobWithFilters>b__0()
   at Hangfire.Server.BackgroundJobPerformer.InvokePerformFilter(IServerFilter filter, PerformingContext preContext, Func`1 continuation)
   at Hangfire.Server.BackgroundJobPerformer.PerformJobWithFilters(PerformContext context, IEnumerable`1 filters)
   at Hangfire.Server.BackgroundJobPerformer.Perform(PerformContext context)
   at Hangfire.Server.Worker.PerformJob(BackgroundProcessContext context, IStorageConnection connection, String jobId)

My background Job class is as follows:

private IBizMovMailer _bizMovMailer;
        private ISmsSender _smsSender;
        private IAppNotifier _appNotifier;
        private IRepository<VideoProject, long> _videoProjectRepository;
        private UserManager _userManager;
        public BizMovNotificationJob(IBizMovMailer bizMovMailer, ISmsSender smsSender, IAppNotifier appNotifier, IRepository<VideoProject, long> videoProjectRepository, UserManager userManager)
        {
            _bizMovMailer = bizMovMailer;
            _smsSender = smsSender;
            _appNotifier = appNotifier;
            _videoProjectRepository = videoProjectRepository;
            _userManager = userManager;

            this.LocalizationSourceName = BizMovConsts.LocalizationSourceName;
        }

        public override void Execute(BizMovNotificationJobArgs args)
        {..
...
}
}

I have tried to add AbpBootrapper in the ApplicationPreload of Hangfire, like this:

public class ApplicationPreload : System.Web.Hosting.IProcessHostPreloadClient
    {
        public void Preload(string[] parameters)
        {
            var bootstrapper = new AbpBootstrapper();


            bootstrapper.IocManager.IocContainer
                .AddFacility<LoggingFacility>(f => f.UseLog4Net()
                    .WithConfig("log4net.config")
                );

            bootstrapper.Initialize();
            HangfireBootstrapper.abpBootstrapper = bootstrapper;
            HangfireBootstrapper.Instance.Start();

        }
    }

but I am still getting the mentioned issue.

Any suggestion on this will be helpful.

Thanks, Gunpal Jain

Hello,

I want to assign TLDs like mynewdomain1.com to tenant site like mytenant1.myhostsite.com, and mynewdomain2.com to tenant site like mytenant2.myhostsite.com. I want to control which domain points to which tenant from host admin panel.

Is there any existing feature like that on this framework?

The solution I'm thinking of right now, is to have a table of all the domains and tenants mappings. and find the tenant id at the application startup by using domain name from Request Url.

Is there any better way to do that?

Regards, Gunpal Jain

Showing 1 to 10 of 11 entries