{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/service-fabric-issues/issues/667","repository_url":"https://api.github.com/repos/Azure/service-fabric-issues","labels_url":"https://api.github.com/repos/Azure/service-fabric-issues/issues/667/labels{/name}","comments_url":"https://api.github.com/repos/Azure/service-fabric-issues/issues/667/comments","events_url":"https://api.github.com/repos/Azure/service-fabric-issues/issues/667/events","html_url":"https://github.com/Azure/service-fabric-issues/issues/667","id":276126382,"number":667,"title":"Custom ActorFactory creates v1 client by default.","user":{"login":"tanwarsatya","id":1289839,"avatar_url":"https://avatars1.githubusercontent.com/u/1289839?v=4","gravatar_id":"","url":"https://api.github.com/users/tanwarsatya","html_url":"https://github.com/tanwarsatya","followers_url":"https://api.github.com/users/tanwarsatya/followers","following_url":"https://api.github.com/users/tanwarsatya/following{/other_user}","gists_url":"https://api.github.com/users/tanwarsatya/gists{/gist_id}","starred_url":"https://api.github.com/users/tanwarsatya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tanwarsatya/subscriptions","organizations_url":"https://api.github.com/users/tanwarsatya/orgs","repos_url":"https://api.github.com/users/tanwarsatya/repos","events_url":"https://api.github.com/users/tanwarsatya/events{/privacy}","received_events_url":"https://api.github.com/users/tanwarsatya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-22T16:17:32Z","updated_at":"2017-11-22T18:10:10Z","closed_at":null,"author_association":"NONE","body":"Similar to #547 \r\n\r\nI have a method to check active actors and when I try to create ActorServiceProxy it's using the V1 client by default.  \r\n\r\nSame method creates a V2 client if before creating ActorServiceProxy I create any other Actor Proxy which has V2.Client attribute specified in Interface. \r\n\r\n` public async Task<List<string>> GetActiveActorsIds()\r\n        {\r\n            ActorProxyFactory factory = new ActorProxyFactory();\r\n             var fabricClient = new FabricClient(); // Re-use as much as possible\r\n\r\n            ServicePartitionList partitionList = await fabricClient.QueryManager.GetPartitionListAsync(_uri);\r\n\r\n            List<string> actorIds = new List<string>();\r\n\r\n            foreach (var partition in partitionList)\r\n            {\r\n                var key = partition.PartitionInformation as Int64RangePartitionInformation;\r\n                \r\n                Microsoft.ServiceFabric.Actors.\r\n\r\n                **IActorService actorServiceProxy = ActorServiceProxy.Create(_uri, key.LowKey);**\r\n\r\n                ContinuationToken continuationToken = null;\r\n\r\n                var cancellationTokenSource = new CancellationTokenSource();\r\n\r\n                do\r\n                {\r\n                    PagedResult<ActorInformation> page = await actorServiceProxy.GetActorsAsync(continuationToken, cancellationTokenSource.Token);\r\n                    actorIds.AddRange(page.Items.Select(x => x.ActorId.GetStringId()));\r\n\r\n                    continuationToken = page.ContinuationToken;\r\n                }\r\n                while (continuationToken != null);\r\n            }\r\n\r\n            return actorIds;\r\n        }\r\n`\r\nWhat should be the default behavior when we are exclusively using the V2.Client by specifying the attribute on my actor interface ?? Challenge here is I am not passing that actor interface and instead the proxy factory returning standard IService. \r\n\r\nOr should we be creating a custom service to register our actors. Currently the main method for my actor service uses ActorService class to register our actors. \r\n\r\n` private static void Main()\r\n        {\r\n            try\r\n            {\r\n\r\n                using (var diagnosticsPipeline = ServiceFabricDiagnosticPipelineFactory.CreatePipeline(\"SchoolWayz-Actors-DiagnosticsPipeline\"))\r\n                 {\r\n\r\n                    // Create default garbage collection settings for all the actor types\r\n                    var settings = new ActorGarbageCollectionSettings(Constants.ActorIdelTimeout, Constants.ActorScanInterval);\r\n                    \r\n                    ActorRuntime.RegisterActorAsync<DeviceMessageQueueActor>(\r\n                                    (context, actorType) => **new ActorService**(context,\r\n                                        actorType,\r\n                                        (s, i) => new DeviceMessageQueueActor(s, i),\r\n                                        null,\r\n                                        null,\r\n                                        new ActorServiceSettings\r\n                                        {\r\n                                            ActorGarbageCollectionSettings = settings\r\n                                        })).GetAwaiter().GetResult();\r\n\r\n\r\n                    // Register SmartTrack Device Actor\r\n                    ActorRuntime.RegisterActorAsync<SmartTrackDeviceActor>(\r\n                    (context, actorType) => new ActorService(context,\r\n                        actorType,\r\n                        (s, i) => new SmartTrackDeviceActor(s, i),\r\n                        null,\r\n                        null,\r\n                        new ActorServiceSettings\r\n                        {\r\n                            ActorGarbageCollectionSettings = settings\r\n                        })).GetAwaiter().GetResult();\r\n\r\n\r\n                    // Register SmartTrack Device Message Processor Actor\r\n                    ActorRuntime.RegisterActorAsync<SmartTrackDeviceMessageProcessorActor>(\r\n                    (context, actorType) => new ActorService(context,\r\n                        actorType,\r\n                        (s, i) => new SmartTrackDeviceMessageProcessorActor(s, i),\r\n                        null,\r\n                        null,\r\n                        new ActorServiceSettings\r\n                        {\r\n                            ActorGarbageCollectionSettings = settings\r\n                        })).GetAwaiter().GetResult();\r\n\r\n                    Thread.Sleep(Timeout.Infinite);\r\n                 }\r\n          \r\n            }\r\n            catch (Exception e)\r\n            {\r\n                ActorEventSource.Current.ActorHostInitializationFailed(e);\r\n                throw;\r\n            }\r\n        }`"},"comment":{"url":"https://api.github.com/repos/Azure/service-fabric-issues/issues/comments/346431355","html_url":"https://github.com/Azure/service-fabric-issues/issues/667#issuecomment-346431355","issue_url":"https://api.github.com/repos/Azure/service-fabric-issues/issues/667","id":346431355,"user":{"login":"amanbha","id":11221966,"avatar_url":"https://avatars0.githubusercontent.com/u/11221966?v=4","gravatar_id":"","url":"https://api.github.com/users/amanbha","html_url":"https://github.com/amanbha","followers_url":"https://api.github.com/users/amanbha/followers","following_url":"https://api.github.com/users/amanbha/following{/other_user}","gists_url":"https://api.github.com/users/amanbha/gists{/gist_id}","starred_url":"https://api.github.com/users/amanbha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amanbha/subscriptions","organizations_url":"https://api.github.com/users/amanbha/orgs","repos_url":"https://api.github.com/users/amanbha/repos","events_url":"https://api.github.com/users/amanbha/events{/privacy}","received_events_url":"https://api.github.com/users/amanbha/received_events","type":"User","site_admin":false},"created_at":"2017-11-22T18:10:10Z","updated_at":"2017-11-22T18:10:10Z","author_association":"NONE","body":"@tanwarsatya Could you please try with specifying the V2 client attribute on the assembly in which you are making the ActorServiceProxy calls."}}
{"actor":{"display_login":"amanbha"}}