ASP.NET Tutorial : Using ASP.NET Core In Phoesion Glow

Leave a Comment

Phoesion Glow is a microservice development framework that offers a complete solution for creating, deploying, and managing your microservices. While Phoesion Glow offers a glow-native SDK for writing services, we often need to use ASP.Net specific features or add a service already written in ASP.Net.

This article will focus on creating Glow microservices using the ASP.Net framework.

Prerequisites / Preparation

For developing Phoesion Glow services, we need a Windows machine with Visual Studio 2019/2022 and Phoesion Glow Blaze for Windows installed.
Creating a new service
 
1. Create a new Solution
Create a new solution using Visual Studio with a Firefly ASP.NET Core Service Project project.

2. Configure new Project

Name your new project and solution :

Project name : Foompany.Services.MyAspService
Location : <Set your location>
Solution name : Foompany.Services
 

The AspFireflyService class

Notice that your ServiceMain class now derives from AspFireflyService instead of the basic FireflyService. The AspFireflyService class provides the necessary IServer implementations that will hook into the ASP.Net framework and host the ASP.Net stack on top of Phoesion Glow. Think of it like a replacement of Kestrel, that instead of handling requests from sockets, it handles request from the Phoesion Glow framework.

Test your services

To test that your services are up and running, open a browser and go to one of the following :

  • http://localhost/MyCompany.Services.MyAspService/Test/Action1
  • http://localhost:16000/MyCompany.Services.MyAspService/Test/Action1

Changing the Service name (base path)

As a part of the Phoesion Glow project, your microservice MUST have a service name so the API Gateway system can route the request to the proper service. Like native Firefly Services, this can be specified using the [ServiceName("XXX")] attribute on the ServiceMain.cs class. Change this to your desired name, for example, just MyAspService (without the full assembly namespace that was added by the templates)

Rerun the project and test using the following :

  • http://localhost/MyAspService/Test/Action1
  • http://localhost:16000/MyAspService/Test/Action1

Summary

In this article, we demonstrated how easy it is to create a new ASP.NET microservice that can be deployed/hosted in our Phoesion Glow setup. We can now fully utilize Phoesion Glow, including the out-of-the-box Mediator, API Gateway, Service-Bus, and Deployment/Managing/Monitoring capabilities.

Windows Hosting Recommendation

HostForLIFEASP.NET receives Spotlight standing advantage award for providing recommended, cheap and fast ecommerce Hosting including the latest Magento. From the leading technology company, Microsoft. All the servers are equipped with the newest Windows Server 2012 R2, SQL Server 2014, ASP.NET 4.5.2, ASP.NET MVC 6.0, Silverlight 5, WebMatrix and Visual Studio Lightswitch. Security and performance are at the core of their Magento hosting operations to confirm every website and/or application hosted on their servers is highly secured and performs at optimum level. mutually of the European ASP.NET hosting suppliers, HostForLIFE guarantees 99.9% uptime and fast loading speed. From €3.49/month , HostForLIFE provides you with unlimited disk space, unlimited domains, unlimited bandwidth,etc, for your website hosting needs.
 
https://hostforlifeasp.net/
Next PostNewer Post Previous PostOlder Post Home

0 comments:

Post a Comment