WCF in webjob returns list of records to webapp - wcf

Is this possible to put WCF in webjob that will return list of records to webapp.Actually I have project that returns search results (searching is done via lucene.net). Is there any guide or way to get results in my webapp from webjob?
Also can anyone guide me on my localhost I am running my webapp and web job is part of same solution. When I run web application, main function of WebJob is not hitting. Web app and web job can run simultaneously? If these are not runs simultaneously then How can I invoke my searching project initially ? How can my web project relate with my web jobs? I know about invoking by queue but some functions should be run initially when web application is started.
I want to test this behavior on my localhost

Is this possible to put WCF in webjob that will return list of records to webapp.Actually I have project that returns search results (searching is done via lucene.net). Is there any guide or way to get results in my webapp from webjob?
As I known, Azure WebJobs provide you with an easy way to run scripts or programs as background process in the context of your Azure Web Apps. You could not get results directly from WebJobs in your Web Application, you need to store your results in a central data center (Azure Queue, Table Storage,Service Bus,etc.), then you need to retrieve the data explicitly in your Web App. Here is a official tutorial about web application working with Azure WebJob.
Also can anyone guide me on my localhost I am running my webapp and web job is part of same solution. When I run web application, main function of WebJob is not hitting. Web app and web job can run simultaneously?
You could right click your solution and select Properties, choose Startup Project under Common Properties, choose Multiple startup projects and configure the Action for your web application and your WebJob. For more details, you could refer to this issue.
UPDATE:

Related

Run exe file alongside .NET Core Web Application

I have an executable file which I would like to run alongside a .NET Core web application. It needs to start when the web application loads and will continuously run until the web application ends. I also need to be able to check if the executable file is still running through the UI, and have an option to start, stop or restart.
I have done a bit of googling already on this and all that keeps returning is examples where the exe file is expected to end at some point, not anything that continuously runs.
Any pointers in the right direction would be great.
Andy's comment is correct. It's recommended to using Background tasks with hosted services in ASP.NET Core.
And you also can use signalr to record the status of your service. You can start, stop by using StartAsync and StopAsync. And it's impossible to restart. The background service was launched with asp.net core.
For more details, you can check the blog:
Communicate the status of a background job with SignalR

Hangfire shared dashboard

.Net Core 2.2
Hangfire.Core 1.6.22
Hangfire.SqlServer 1.6.22
Hangfire 1.6.22
I have created a sample proof of concept for using Hangfire for multiple applications (2 console applications) but with a shared database and dashboard (a separate web app). It works wonderfully except that the dashboard shows either "could not load file or assembly" or "Can not find the target method" on the list of succeeded jobs.
Everything succeeds so that is good, but the dashboard is unable to display the name/description of the job without having a reference to the application dll where the job method is.
Is there a way to specify the job name/description instead of requiring the dashboard to have a reference to the application dll just to retrieve this name/description? I tried using the DisplayName attribute but that doesn't work either. If I reference the application project from the dashboard project then it works OK, but I really do not want to have to reference every project from the dashboard project just to populate this description.

start service from asp.net core web application

I am Building web application on asp.net core.
my application needs some data once in a week.
I have created console application which gets this data (really, it parses some website once in a week and stores that data in a database).
I have configuration file when should that console application start to get that data.
My question is how to start that console application from my web app and is it a good idea to start console application from web application?
IMHO it's not best practice to start a console application from an web application. If you would like to do that, please consider using a Windows Service with an timer or a cron job for that.
What you can do is create a scheduled tasks using Windows Task Scheduler. This task's action will be to State a Program and then you can set Program/Script to your console exe file. You can schedule this task to run once a week.
You can check this task history to ensure the task is executing weekly and can run it manually in case of failure.

SpringBoot: How to reload application.property file in few second without restart application?

I am working on a java web service application which is using SpringBoot framework. I put properties into the application.properties file parallel to the jar. Afterward, I restart the application and new properties are picked by web service.
Now my requirement is, my web service keep reload the property file after few time (lets say 5000ms) and I do not want to restart the web service. Is there any way in SpringBoot to achieve this?
Thanks,
Harsh
If you are using spring cloud starter dependencies, you will get a /refresh endpoint for this purpose to POST to. It refreshes the configuration from property files without interrupting the service.

Custom service application - proxy stopped

Ive created a custom service app using samples from Tony Bierman and MS. I can see the application in central admin, I can create a new service app from it, the create page works, the manage page is blank and I don't have a properties page. I havent yet tried using the beast, I just want to get the deployment and admin stuff working first. It deploys ok and I can create an instance.
However, after creating it, I see the Service app has started but the app proxy is stopped.
I dont know if this is a problem or not but I cant find anywhere to start it.
Should I worry?
Turns out that yes, I do need to worry. The problem was I had the proxy package feature receiver scoped to web rather farm. Took me a week to find this :(