示例#1
0
        private Channel CreateChannel(PubSubDefinition definition)
        {
            if (null == definition)
            {
                throw new ArgumentNullException(nameof(definition));
            }

            return(new Channel(definition.Namespace, definition.Identifier, definition.Persisted, definition.Address, _logger));
        }
示例#2
0
        private IObjectSerialization GetSerializer(PubSubDefinition definition)
        {
            if (null == definition)
            {
                throw new ArgumentNullException(nameof(definition));
            }

            if (null == definition.Serializer || !_serviceProvider.TryResolve <IObjectSerialization>(definition.Serializer, out var serializerFactory))
            {
                return(_serviceProvider.Resolve <IObjectSerialization>());
            }

            return(serializerFactory);
        }