Giter Club home page Giter Club logo

Comments (4)

alexmg avatar alexmg commented on June 26, 2024

I removed the need to have two calls to register a service. The second call that was required to register the factory method with the SF runtime should no longer be required. To make this call you needed to have the constructed container in your hand. Basically the RegisterActorServiceFactory, RegisterStatefulServiceFactory and RegisterStatelessServiceFactory methods have been removed.

The dependency on Autofac was increased to 4.5 because I added a feature to the core library to make this possible. A build callback is added to the ContainerBuilder and that gets provided the constructed container when Build is called. So now when calling a method like RegisterStatelessService, the service is registered with the container, and a callback is added to the ContainerBuilder that will add the factory to the SF runtime.

Because you need to provide the service type name for stateless/stateful services I also removed support for adding all services from an assembly. This was only applicable to the first call of registering the service with the container. You still had to make a second call to provide the service type name when registering the factory.

These changes were made because I started writing a blog post about the integration, and when I got to the point of trying to explain why you needed two separate calls, I decided things needed to be simpler (or at least appear to be so from the outside). I have updated a local sample solution with these changes and they were working fine. I might try to get that solution up to the https://github.com/autofac/Examples repository.

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

I have created a Service Fabric demo application and pushed it to the Examples repository. It has its own solution file due to the Service Fabric dependencies that are required to build and run it successfully.

https://github.com/autofac/Examples/tree/master/src/ServiceFabricDemo

The solution was created with Visual Studio 2017 and version 2.5.216 of the Service Fabric SDK.

from autofac.servicefabric.

johnkattenhorn avatar johnkattenhorn commented on June 26, 2024

@alexmg - I've just taken a quick look at the example and it looked as I thought it would so there must have been something else wrong with our code base. I'll look into this later this week and upgrade to alpha-2 again.

Like you pointed out it's a little simpler than alpha-1.

One additional thing we've done which might help is we placed an action into the factory to allow us to log the entire stack when something wasn't registered correctly. The SF explorer helpfully cut's off the text from the exception and it's too hard digging through the EventSourcing :-)

from autofac.servicefabric.

alexmg avatar alexmg commented on June 26, 2024

from autofac.servicefabric.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.