Comments (4)
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.
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.
@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.
from autofac.servicefabric.
Related Issues (20)
- InstancePerMatchingLifetimeScope HOT 2
- Reduced extensibility due to access restrictions in classes and methods HOT 3
- Allow logging exceptions during service instantiation HOT 8
- Access denied in RegisterActor HOT 5
- How to communicate to stateful service use remoting? HOT 2
- How to inject custom ActorService HOT 2
- How to use Serilog, Autofac and Service Fabric Actors together HOT 3
- Dynamic Proxy breaks optional constructor arguments
- Cannot create Stateless Service in Service Fabric injecting my own objects in HOT 2
- Service class constructor never invoked
- Lifetime scope for Actor instance HOT 2
- Not support 6.3.187 HOT 1
- Allow use of current ILifetimeScope in the exception callback HOT 1
- ServiceFabricModule is internal, visible to Autofac RegisterAssemblyModules, but cannot be constructed HOT 8
- Message "Access is denied
- Cannot resolve parameter 'System.Fabric.StatefulServiceContext serviceContext' HOT 2
- Singleton does not play nicely with ServiceContext dependency HOT 1
- MissingMethodException after update to Autofac 5.0.0 HOT 1
- Compatibility with Autofac v6 HOT 1
- Allow injecting additional registrations during the creation of service lifetimescope HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autofac.servicefabric.