eShopOnContainers | NET sample microservices and container based application | Continuous Deployment library

 by   dotnet-architecture C# Version: 6.0.0 License: MIT

kandi X-RAY | eShopOnContainers Summary

kandi X-RAY | eShopOnContainers Summary

eShopOnContainers is a C# library typically used in Telecommunications, Media, Telecom, Devops, Continuous Deployment, Docker applications. eShopOnContainers has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              eShopOnContainers has a medium active ecosystem.
              It has 23408 star(s) with 10024 fork(s). There are 1498 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 31 open issues and 1206 have been closed. On average issues are closed in 59 days. There are 15 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of eShopOnContainers is 6.0.0

            kandi-Quality Quality

              eShopOnContainers has 0 bugs and 0 code smells.

            kandi-Security Security

              eShopOnContainers has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              eShopOnContainers code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              eShopOnContainers is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              eShopOnContainers releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              eShopOnContainers saves you 11524 person hours of effort in developing the same functionality from scratch.
              It has 24099 lines of code, 0 functions and 696 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of eShopOnContainers
            Get all kandi verified functions for this library.

            eShopOnContainers Key Features

            No Key Features are available at this moment for eShopOnContainers.

            eShopOnContainers Examples and Code Snippets

            No Code Snippets are available at this moment for eShopOnContainers.

            Community Discussions

            QUESTION

            Generic Method in Java with out parameters
            Asked 2022-Mar-05 at 19:22

            I am trying to implement something similar to EventBus implemented in eshopOnContainers.

            Is it Possible to define a method like this in java & read the meta data about T and TH at runtime ? There can be multiple classes extending IntegrationEvent(e.g. PriceChangedEvent) & we should be able to Identify the exact class name at runtime.

            ...

            ANSWER

            Answered 2022-Mar-05 at 19:22

            You can pass type info into method:

            Source https://stackoverflow.com/questions/71362893

            QUESTION

            Is there an easy way to health-check an Azure blob storage with multiple keys?
            Asked 2022-Jan-28 at 08:23

            I am building an Azure web service using ASP.NET Core (C#, .NET 6). I have an Azure storage account. The storage account has two (2) access keys. The idea is that if the first key expires or needs to be changed, the application can seemlessly switch to the second key while operators renew the first key.

            My application has a health check, and I would like to include a health check of the storage account. I took inspiration from this article: https://docs.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/monitor-app-health#healthchecks-implementation-in-eshoponcontainers

            I wrote code like this, using NuGet package AspNetCore.HealthChecks.AzureStorage:

            ...

            ANSWER

            Answered 2022-Jan-28 at 08:23

            I looked at the implementation of AspNetCore.HealthChecks.AzureStorage.

            https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/2f582f42a3e5c7dc73bfdb114d6031d711552af6/test/HealthChecks.AzureStorage.Tests/DependencyInjection/AzureBlobStorageRegistrationTests.cs

            It is actually really simple. It just checks whether a blob container exists.

            So I just did my own implementation using the same idea but retrying if the first key does not work. (I already had a generic way to retry an operation if the first key fails.)

            Source https://stackoverflow.com/questions/70879925

            QUESTION

            Accessing the GRPC Service within docker-compose
            Asked 2021-Aug-30 at 09:22

            I am currently following the tutorial for eShopOnContainers, and I decided to try to test out the GRPC functionality, similar to the project.

            What I am trying to build is GRPC Client and GRPC Service, which are both hosted on docker and can talk to each other. Now, I managed to make it work, and if you look a the Startup.cs in GRPC Client, this Uri http://host.docker.internal:5104 manages to make the call and get the response.

            However, the original eshopOnContainers project uses the http://basket-api:81 path, which is much nicer and in my opinion more maintainable. It also uses few more components and some configuration:

            1. The GRPC Service uses the following in Startup.cs:
              app.UsePathBase("/basket-api") Original project
              and some configuration in Program.cs to listen to ports:
            ...

            ANSWER

            Answered 2021-Aug-27 at 12:35

            You should be able to use docker generated DNS name from your docker-compose file. Your GRPC client should be able to reach the server on http://grpcserver:5103

            With docker-compose you can talk between containers simply by using the name of the service and the port that you are exposing in the container.

            [Edit] Removed the extension from the path because UsePathBase()

            Adds a middleware that extracts the specified path base from request path and postpend it to the request path base.

            UsePathBase

            Source https://stackoverflow.com/questions/68946046

            QUESTION

            Issues getting an api with swagger to authenticate with IdentityServer4 using .net5.0
            Asked 2021-Mar-19 at 04:44

            I am currently learning how microservices work for an application i am building for my portfolio and for a small community of people that want this specific application. I have followed a tutorial online and successfully got IdentityServer4 to authenticate an MVC Client, however, I am trying to get swagger to work alongside the API's especially if they require authentication. Each time I try to authorize swagger with IdentityServer4, I am getting invalid_scope error each time I try authenticate. I have been debugging this problem for many hours an am unable to figure out the issue. I have also used the Microsoft eShopOnContainers as an example but still no luck. Any help would be greatly appreciated. Ill try keep the code examples short, please request any code not shown and ill do my best to respond asap. Thank you.

            Identiy.API project startup.cs:

            ...

            ANSWER

            Answered 2021-Mar-19 at 04:44

            The swagger client needs to access the api and to do so it requires api scopes. What you have for swagger scopes are not doing this. Change the scopes for swagger client ‘weatherswaggerui’ to include the api scopes like this:

            AllowedScopes = {"weatherapi.read"}

            Source https://stackoverflow.com/questions/66665905

            QUESTION

            Unable to forward API calls through Envoy (v1.17.0) to their respective routes inside docker-compose (v1.27.4)
            Asked 2021-Feb-28 at 14:32

            tl;dnr

            I can not get my docker-compose Envoy API gateway to properly forward to referenced services.

            "Forwarded routes" always end up with the error:

            ...

            ANSWER

            Answered 2021-Feb-28 at 14:32

            I'm going to give it a few more days, but I think I discovered the issues ... which appear to be fat-fingers, copy & paste.

            1. I removed the offending empty http2 options as mentioned in the above comment. This resolved in the clusters being a bit cleaner:

            Source https://stackoverflow.com/questions/66408670

            QUESTION

            Why Doesn't have any Class in Program.cs in .NET Core 5?
            Asked 2021-Feb-25 at 12:55

            I am trying to work with .NET 5 to update my information. So I started to review the eShopOnContainers-ServicesAndWebApps project here.

            I have read its older versions (2.2 and 3.1) that is a rich sample with a lot of fantastic points. But here in .NET 5, at first glance, in Program.cs, I see a lot of methods and properties without any classes which I can't understand and make me confused. How can we have methods without class in a cs file?

            ...

            ANSWER

            Answered 2021-Feb-25 at 12:08

            It's a feature of C# 9: top-level statements

            Top-level statements remove unnecessary ceremony from many applications.

            Only one file in your application may use top-level statements. If the compiler finds top-level statements in multiple source files, it’s an error. It’s also an error if you combine top-level statements with a declared program entry point method, typically a Main method. In a sense, you can think that one file contains the statements that would normally be in the Main method of a Program class.

            So you can now write a program that contains only this line of code:

            Source https://stackoverflow.com/questions/66368179

            QUESTION

            Read model/aggregate code organization in simplified DDD/CQS pattern where read model from other domain is needed
            Asked 2021-Feb-14 at 19:43

            First of all as for "simplified DDD/CQS pattern" I am referencing https://github.com/dotnet-architecture/eShopOnContainers example dotnet application (which is not "strict" DDD/CQRS). However I am not dotnet developer and my question is related to general design patterns / code organization.

            My own case is as follows: I have "conference" domain with "conference" root aggregate and "conference_edition" aggregate. In RDBMS language conference has many editions. In this domain all "communication" with outside world is done through root aggregate "conference". So there are use cases like Conference.create(), Conference.addDraftEdition(), Conference.publishEdition() etc.

            I have also "booking" domain which manages bookings for specific conference editions (people book tickets for a conference edition).

            My question is related to the read model / aggregate of "conference" service (domain?). CMS of this application needs following read model for a conference (example in json for simplicity):

            ...

            ANSWER

            Answered 2021-Feb-14 at 19:43

            Either of the first or second is reasonable. The choice between them will be heavily influenced by how much you want to spread business logic into infrastructure.

            Since the conference and booking domains appear to be different bounded contexts, the third option is really only justifiable if there's some change to a conference edition that's only allowable if bookings are in a certain state.

            Source https://stackoverflow.com/questions/66126094

            QUESTION

            Cast object to Task and set T from variable with type Type
            Asked 2021-Jan-24 at 18:48

            It's a little bit difficult to explain, I apologies for that. But I need help. I'm working on generic approach for events. All my code base on eShopOnContainers example but my handlers should return a value.

            In eShopOnContainers there is just Task as a return type, so they can easy

            ...

            ANSWER

            Answered 2021-Jan-24 at 18:46

            To solve your problem a simple solution is to use dynamic (see here).

            Source https://stackoverflow.com/questions/65874446

            QUESTION

            In "eshoponcontainers", most of the dockerfiles have copy(all csproj) and restore, does it not make overhaed on container?
            Asked 2021-Jan-05 at 18:27

            I can see comment in each dockfile

            Keep the project list and command dotnet restore identical in all Dockfiles to maximize image cache utilization

            But I have confusion with,

            1. it would build the fast(due to caching) but does it not take extra space in container FS.
            2. And in future if I add new project in solution should I make to change every dockerfile.

            Here https://github.com/dotnet-architecture/eShopOnContainers/blob/dev/src/Services/Basket/Basket.API/Dockerfile basket-api docfile have copy command on projects.

            ...

            ANSWER

            Answered 2021-Jan-05 at 18:27

            The reason for doing this is to take advantage of Docker's layer caching. Yes, there is maintenance overhead to ensure that the list here reflects the actual set of project files that are defined in the repo.

            The caching optimization comes into play for iterative development scenarios (inner loop). In those scenarios, you're typically making changes to source code files, not the project files. If you haven't changed any project files since you last built the Dockerfile, you get to take advantage of Docker's layer caching and skip the restoration of NuGet packages for those projects, which can be quite time consuming.

            Yes, there is a small amount of extra space being included in the container image because the project files end up getting copied twice which results in duplicate data amongst the two layers. But that's fairly small because project files aren't that big.

            There are always tradeoffs. In this case, the desire is to have a fast inner loop build time at the expense of maintenance and a small amount of extra space in the container image.

            Source https://stackoverflow.com/questions/65582351

            QUESTION

            How do you structure physical and logical/solution folders?
            Asked 2020-Nov-18 at 20:11

            After a lot of reading and wading through finnicky solutions to this problem, it's bizarre that projects are structured in this way and yet there doesn't seem to be a straight forward way of creating it.

            A brilliant example is Microsoft's eShopOnContainers project - https://github.com/dotnet-architecture/eShopOnContainers

            The repository has a physical src folder, when you open the eShopOnContainers-ServicesAndWebApps.sln - the solution explorer displays the src as if it were a logical folder.

            I find that the .sln also lives in a peculiar place - directly within the src folder, it's almost like this .sln has been created manually and projects added to it as necessary.

            The same is the case with the Services folder and its contents, each project lives as Services/Identity/Identity.API - this full structure displays in both file explorer and solution explorer, but when I attempt to recreate this I can 1 of 2 scenarios -

            1. I create the folder structure as physical folders and they do not display in the solution explorer.
            2. I create the folder structure as logical/solution folders and they do not display in the file explorer.

            This doesn't seem possible via the projection create GUI, I imagine this has been done by creating the projects and structure via the dotnet CLI, but I can't seem to figure it out, how is this done?

            ...

            ANSWER

            Answered 2020-Nov-18 at 20:11

            The solution to this via the Visual Studio GUI -

            Create your logical folder structure as you see fit within Visual Studio, and then to have your physical folders match that structure - or even differ from it - create the path along with the project which you are creating, the file system will create the physical folders from the specified path and you will have achieved the desired effect.

            Example:

            Create C:\myproject\src\

            Visual Studio -> File -> New -> Project -> Blank Solution (name: myprojectsolution)

            Right click myprojectsolution -> Add -> New Solution Folder (name: src)

            My the myprojectsolution.sln into C:\myproject\src\ then delete the myprojectsolution folder which was created with the .sln file.

            Logical and Physical folders are now matching, the .sln lives directly in src, and src will display in the solution explorer.

            At this point, let's say you want to create an Identity.IDP project at Microservices\Identity\Identity.IDP, with a matching logical and physical structure.

            Visual Studio -> right click src -> Add -> New Solution Folder (name: Microservices)

            Visual Studio -> right click Microservices -> Add -> New Solution Folder (named: Identity)

            Visual Studio -> right click Identity -> Add -> New Project (name: Identity.IDP, location: C:\myproject\src\Microservices\Identity)

            The above will result in a matching folder structure existing in both the solution explorer and the file explorer.

            In summary - create your solution structure via the Visual Studio GUI, create your physical structure via specifying the path when creating the project.

            Source https://stackoverflow.com/questions/64849087

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install eShopOnContainers

            Make sure you have installed and configured docker in your environment. After that, you can run the below commands from the /src/ directory and get started with the eShopOnContainers immediately.

            Support

            You can find the related reference Guide/eBook focusing on architecting and developing containerized and microservice-based .NET Applications (download link available below) which explains in detail how to develop this kind of architectural style (microservices, Docker containers, Domain-Driven Design for certain microservices) plus other simpler architectural styles, like monolithic apps that can also live as Docker containers.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link