GithubHelp home page GithubHelp logo

steeltoeoss / steeltoe Goto Github PK

View Code? Open in Web Editor NEW
986.0 43.0 161.0 26.07 MB

Steeltoe .NET Core Components: CircuitBreaker, Configuration, Connectors, Discovery, Logging, Management, and Security

Home Page: https://steeltoe.io

License: Apache License 2.0

C# 99.93% PowerShell 0.07%
microservices cloud-native application-monitoring configuration service-discovery load-balancer dotnet-core dotnet

steeltoe's Introduction

Steeltoe .NET Open Source Software

Build Status

Why Steeltoe?

Are you looking to create .NET microservices? Modernizing existing applications? Moving apps to containers? Steeltoe can help you!

Steeltoe is an open source project that provides a collection of libraries that helps users build production-grade cloud-native applications using externalized configuration, service discovery, distributed tracing, application management, and more.

We have also built several tools to get you started:

  • Steeltoe Initializr - Pick and choose what type of application you would like to build and let us generate the initial project for you
    • Not only have we built Steeltoe Initializr site, but our templates are also available as an option from the dotnet CLI
    • We also have the ability to load these project templates inside of Visual Studio
  • Steeltoe Samples - Here we have working samples for trying out features and to use as code references

Project Information

For more project information, please see our Steeltoe Wiki

See our website for lots of information, blogs, documentation, and getting started guides

For community support, we recommend our Steeltoe OSS Slack channels or StackOverflow

For production support, we recommend you reach out to VMware Tanzu Support

Other questions or feedback open an issue

Conduct

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information see the .NET Foundation Code of Conduct.

steeltoe's People

Contributors

antonpopov avatar bart-vmware avatar ccheetham avatar cesinhaugusto avatar cieciurm avatar cshung avatar davgia avatar dgodd avatar dtillman avatar eerhardt avatar fennekit avatar hananiel avatar jkonicki avatar karql avatar kenswan avatar kimbell avatar kishoreallwynraj avatar macsux avatar majian159 avatar mavenraven avatar mzakrzewski avatar nemruddemir avatar pengweiqhca avatar spring-operator avatar thebritz avatar thompson-tomo avatar tillig avatar timhess avatar tscrypter avatar vakadavr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steeltoe's Issues

Missing IntelliSense comments

There is a lot of missing IntelliSense comments in the Connectors code, especially in the EFCore and ConnectorBase projects.

Serilog .NET Framework Support

Currently Dynamic Logger support with Serilog is limited to Core. We are looking to see how much interest there is in supporting framework support.

Running with Consul Throws CheckID does not have associated TTL

Hello,

I'm testing out discovery with Consul. I have setup my application like this:

Nuget:

<PackageReference Include="Steeltoe.Discovery.ClientCore" Version="2.2.0" />
<PackageReference Include="Steeltoe.Management.CloudFoundry" Version="1.1.0" />

Startup.cs

public void ConfigureApplication(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime)
{
    app.UseDiscoveryClient();
}

public void ConfigureServices(IServiceCollection services, IConfigurationRoot config)
{
    services.AddDiscoveryClient(config);
}

appsettings.json

"consul": {
    "host": "localhost",
    "ttl":  "5",
    "discovery": {
      "serviceName": "Test",
      "healthCheckUrl": "/health",
      "heartbeat:enabled": true,
      "heartbeat:ttlValue": "5"
    }
  },

Started docker instance of consul with:

docker run -p 8500:8500 -d --name=dev-consul consul

Then when I start my application I get this error message:

Consul.ConsulRequestException
HResult=0x80131500
Message=Unexpected response, status code InternalServerError: CheckID "service:Test-1128208441" does not have associated TTL
Source=Consul
StackTrace:
at Consul.PutNothingRequest.d__5.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Steeltoe.Discovery.Consul.Discovery.TtlScheduler.<b__11_0>d.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Threading.ThreadPoolWorkQueue.Dispatch()

Am I missing some configuration?

Error BC30560 'OpenIdConnectOptions' is ambiguous in the namespace 'Steeltoe.Security.Authentication.CloudFoundry.Owin'.

###Title
VB.NET compile error: 'OpenIdConnectOptions' is ambiguous in the namespace 'Steeltoe.Security.Authentication.CloudFoundry.Owin'.

Issue

Error BC30560 'OpenIdConnectOptions' is ambiguous in the namespace 'Steeltoe.Security.Authentication.CloudFoundry.Owin'.

Expected Result

solution would compile successfully

Actual Result

Build fails with the above error message

Steps to Repro

Create a VB.Net project. add the Startup.vb contents

Imports Microsoft.Owin
Imports Microsoft.Owin.Security
Imports Microsoft.Owin.Security.Cookies
Imports Owin
Imports Steeltoe.CloudFoundry.Connector
Imports Steeltoe.CloudFoundry.Connector.Services
Imports Steeltoe.Security.Authentication.CloudFoundry.Owin



<Assembly: OwinStartup(GetType(yournamespace.Startup))>
Namespace yournamespace
    Public Class Startup
        Public Sub Configuration(ByVal app As IAppBuilder)
            app.Use(Function(context, [next])
                        context.Request.Scheme = "https"
                        Return [next]()
                    End Function)

            app.SetDefaultSignInAsAuthenticationType("ExternalCookie")
            app.UseCookieAuthentication(New CookieAuthenticationOptions With {
                .AuthenticationType = "ExternalCookie",
                .AuthenticationMode = AuthenticationMode.Active,
                .CookieName = ".AspNet.ExternalCookie",
                .ExpireTimeSpan = TimeSpan.FromMinutes(5)
            })

            Dim serviceInfos = CloudFoundryServiceInfoCreator.Instance(ApplicationConfig.Configuration)
            Dim ssoInfo = serviceInfos.GetServiceInfos(Of SsoServiceInfo)().FirstOrDefault()

            If ssoInfo Is Nothing Then
                Throw New NullReferenceException("Service Info Not Found")
            End If

            app.UseOpenIDConnect(New OpenIdConnectOptions() With {
                .ClientID = ssoInfo.ClientId,
                .ClientSecret = ssoInfo.ClientSecret,
                .AuthDomain = ssoInfo.AuthDomain,
                .AppHost = ssoInfo.ApplicationInfo.ApplicationUris.First(),
                .AppPort = 0,
                .ValidateCertificates = False
            })
        End Sub
    End Class
End Namespace

Further Details

n/a

Default RabbitMQ ConnectionFactory ServiceLifetime

With Steeltoe ConnectorCore, RabbitMQ's ConnectionFactory is injected with ServiceLifetime.Scoped by default. When used in a web-based project, a new connection may be opened on every web request.

The default setting should probably be changed to Singleton

Oracle DB Connector Support

Is there a support for the health check of the Oracle DB? I see there are some implementation for OracleServiceInfo but there are no OracleProviderConnectorFactory and OracleProviderConfigurer implementations. Any specific reason for it? If not, can we go ahead and contribute on it?

GetStringAsync in synchronization?

@TimHess hi, when I use steeltoe in synchronization method, there is an error, sample code:

[HttpGet]
public IHttpActionResult GetServices()
{
    var data = DiscoveryHttpClientHelper._httpClient.GetStringAsync(GET_SERVICES_URL).Result;
    return Ok(data);
}

I read the code of DiscoveryHttpClientHandlerBase.cs and found this line:

return await base.SendAsync(request, cancellationToken);

I modified and it work(reference HttpClient.cs):

var task = base.SendAsync(request, cancellationToken);
return await task.ConfigureAwait(false);

Failing Health checks may cause app to be restarted

On some platforms (for example, PCF) when the health actuator is configured as the application's health check endpoint and a non-200 status code is returned on an HTTP health check, the application is restarted.

Steeltoe should provide an optional means of indicating that a dependency is down, without failing the entire healthcheck failing

AWS support

This Epic will track the work for Steeltoe components built to simplify the development process on AWS.

EurekaBase potential for NullReferenceException when no instance id exists

Whilst testing the Eureka Discovery client found that applications were not being returned. Investigation showed that the Eureka app data was missing an instance id for one of the application elements causing a NullReferenceException within Applications.cs, method AddInstanceToVip on the following line (currently line number 147)

instances[info.InstanceId] = info;

Async Health() method in IHealthContributor interface

Note: Moved from Connectors repository

Origin: User feedback
Issue 1: Is there a reason Steeltoe doesn't have an async Health() method within this Steeltoe.Common.HealthChecks.IHealthContributor interface?

Issue 2: Any reason a noun like Health() was chosen as a method name vs. something like AssessHealth()? Could we look into changing this?

Serilog Implementation - Hijack ILoggerFactory

Hello,

I first off want to thank you guys for the great work of the steeltoe library for .NET, really is great.

I wanted to see with you guys if you were open to have a UseSerilogDynamicConsole implementation a bit like UseSerilog.

The problem I had is that I wanted to replace the whole console logger with the one provided by Serilog. I also wanted to control my loggerconfiguration through code rather than through the configuration file (appsettings) as certain sinks are tough to control using the json settings configuration.

I can make a PR with the changes if you wish. I tested it and it works the way i want it to work.
Basically it consists of having an extension on IWebHostBuilder, having a Factory class (similar to Serilog) and using your dynamicprovider (using another constructor)

Let me know if it's something you guys would be interested in having. It definitely can be enhanced to mimick UseSerilog extension, but I wanted to make it work for my needs.

Refresh configuration without restart, but behind load balanced URL

I am currently using Steeltoe in an environment which is behind a load balanced URL, and looking for a means to refresh the configuration without restarting. The load balancer directs traffic to several different Cloud Foundry environments, each of which could have 1 to many instances of the app running via autoscaler.

I've read through previously reported issues and noted this issue which mentions IOptionsSnapshot and the /reload endpoint, as well as IConfigurationRoot.Reload. Based on my current understanding, Steeltoe users with a similar load balanced environment may have an issue with finding a way to reload configs across all environments, for all app instances, as a call to the /reload endpoint would only hit
a single environment/instance. Hopefully I am overlooking a solution to this issue.

If not, I noticed that perhaps the ideal solution is in the backlog. I am not intimately familiar with the Steeltoe source code yet, but is this a feasible addition, or is this a serious undertaking? I would love to help contribute to implementing this, but thought I would first check if others have looked into it already and noticed significant blockers.

NullReference exception while running Management endpoints sample

Hi,

I ran the "CloudFoundryWeb" sample below
https://github.com/SteeltoeOSS/Samples/tree/dev/Management/src/AspDotNet4/CloudFoundryWeb

The sample run as it is in my laptop. But when i comment out below line in ManagementConfig.cs and enabled only the ActuatorConfigurator.UseHealthActuator i am getting NullReference exception while accessing the Health endpoint.

ActuatorConfigurator.UseCloudFoundryActuators(configuration, dynamicLogger, GetHealthContributors(configuration), apiExplorer, loggerFactory);

The sample runs only when i also uncomment the "ActuatorConfigurator.UseCloudFoundrySecurity" line as well. My intention is to run this health endpoint in an API which is already running in a VM in OnPrem environment. So having a line in codebase which refers to CF security would be confusing and also maynot go well with internal security team. Please clarify if there is a workaround to use this Health endpoint without all the added CF related complexities.

Regards
Kishore Allwynraj

PostgreSQL connector support for 'Search Path'

PostgreSQL connector does not supports Search Path when the connectionString is built from a cloud foundry binding. Note that adding Search Path=myschema; dirrectly to the connectionString when working locally works fine.

This works fine locally, but is overridden when deploy in cloud foundry.

{
  "postgres": {
    "client": {
      "ConnectionString": "User ID=root;Password=myPassword;Host=localhost;Port=5432;Database=myDataBase;Search Path=mySchema"
    }
  }
}

I would suggest adding support for postgres:client:searchpath.

{
  "postgres": {
    "client": {
      "ConnectionString": "User ID=root;Password=myPassword;Host=localhost;Port=5432;Database=myDataBase;",
      "SearchPath": "mySchema"
    }
  }
}

Register Docker Application in Eureka with "preferIpAddress": true

When I register application in IIS and point it to Eureka as shown in this sample, it properly works with these parameters in appsetting.json.
"eureka": {
"client": {
"serviceUrl": "http://172.15.100.155:8761/eureka/",
"shouldFetchRegistry": false
},
"instance": {
"port": 8091,
"hostName": "fortune_service",
"ipAddress": "http://172.15.100.11",

  "preferIpAddress": true
  // Remove comments to enable SSL requests
  // More changes in Program.cs are required if using direct C2C communications
  //,"securePortEnabled": true
}

}

When I point cursor over the Eureka Status it shows me the status url (IP I have given above)

But when I run application as a Docker and retrieve value from Confi-Server, it get registered with a dynamic IP for the status and I am unable to discover registered URL. Kindly expect help from someone.

Resilience4j support

I've come accross Netflix Hystrix and Netflix has put it on maintenance mode.

Hystrix is known for its circuit breaking capabilities, but it doesn't stack well with other concerns such as
Rate limiting
Bulkheading
Automatic retrying (sync and async)
Response caching
Timeout handling

They point to Resilience4j which should be used for new project and which is better to play with (stack on) the concerns above.

Are you guys planning to support this, i.e. make a lib for that?

How do you add a custom ServiceInfoFactory?

We are using the Vault service broker for PCF and I'm trying to follow the pattern in this repo for a nice, robust connection mechanism.

The roadblock I'm hitting is that most of these start with something like:

config.GetSingletonServiceInfo<RedisServiceInfo>();

This invokes, a roundabout way, the CloudFoundryServiceInfoCreator.BuildServiceInfoFactories method, which scans only the Steeltoe.CloudFoundry.Connector assembly for service info factory implementations.

This ServiceInfo that gets created is later used in extension methods like this one for Redis as the "base configuration" for a connection, left to be enhanced by additional client configuration.

Problem is, I can't figure out how to get my service info factory into play to be used when service info is getting retrieved. The set of service info objects gets cached with individual CloudFoundryServiceInfoCreator instances so while I could create some sort of additional extension method that might work like this...

config
  .AddVaultServiceInfo()
  .GetSingletonServiceInfo<VaultServiceInfo>();

...having to remember to add that call every time isn't so cool.

If there's not already a solution for this, I could imagine one possible solution being the ServiceInfo implementation getting marked with an attribute indicating its factory type and having the CloudFoundryServiceInfoCreator discover factories in that way rather than (or in addition to?) assembly scanning.

However, I didn't see anything in the samples repo showing this so I figured I'd ask.

ExporterCore zipkin issue no trace logged

Hello there,

I m trying to add distributed tracing to some projects (to create some demo for other teams). So I added some steeltoe into the mix.

I followed some stuff already present online like :

https://steeltoe.io/docs/steeltoe-management/#2-3-exporting

http://www.hlike.cn/article.php?id=15296

https://zipkin.io/

startup.cs

using Steeltoe.Management.Tracing;
using Steeltoe.Management.Exporter.Tracing; 

            services.AddDistributedTracing(Configuration);

            // Export traces to Zipkin
            services.AddZipkinExporter(Configuration);

            // Start up trace exporter
            app.UseTracingExporter();

my appSettings.json looks like

  "management": {
    "tracing": {
      "alwaysSample": true,
      "egressIgnorePattern": "/api/v2/spans|/v2/apps/.*/permissions|/eureka/.*|/oauth/.*",
      "exporter": {
        "zipkin": {
          "endpoint": "http://localhost:9411/api/v2/spans",
          "validateCertificates": false
        }
      }
    }
  },

My program.cs

                .ConfigureLogging((builderContext, loggingBuilder) =>
                {
                    loggingBuilder.ClearProviders();
                    loggingBuilder.AddConfiguration(builderContext.Configuration.GetSection("Logging"));
                    loggingBuilder.AddDynamicConsole();
                });

My log is set to true as exportable
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
[AccesTi.Carts,f98fa5f63f5ed284,3842eb84bd4ec954,,true] Request starting HTTP/1.1 GET https://localhost:44300/api/Carts
but I also see (don't know if its relevant but seems fishy) :

dbug: Steeltoe.Management.Tracing.Observer.HttpClientCoreObserver[0]
      HandleStartEvent: Ignoring path: /api/v2/spans
dbug: Steeltoe.Management.Tracing.Observer.HttpClientCoreObserver[0]
      HandleStopEvent: Missing span context

image

I don't know why my request are not sent to the zipkin server i must be missing something.

thanks for the help

Support for multiple configuration fragment loads for an application

This request was taken from #29 by @ahusic-clgx

I would very much like a support for multiple configuration fragment loads for an application. What I was thinking about was extending "Pivotal.Extensions.Configuration.ConfigServer.ConfigServerClientSettings" with new property called "Fragments":

public class ConfigServerClientSettings
{
public Collection Fragments{ get; } = new Collection();
}

and then use this collection of strings in "ConfigServerConfigurationProvider" class to load each fragment along side application configuration. It would be app's responsibility to provide fragments it needs (besides its own) to successfully work.

This way, I can load not only app configuration, but any other "shared fragment" application needs.

Thank you very much.

Application name in manifest.yml is overriding spring:application:name in appsettings.json

To support Blue/Green deployments we apply a version number suffix on the application name in the manifest.yml when pushing to PCF:

---
applications:
- name: appname-v1-0-1
  path: ./bin/linux-x64
  memory: 256MB
  stack: cflinuxfs3
  buildpacks:
  - dotnet_core_buildpack
  instances: 1
  env:
    ASPNETCORE_ENVIRONMENT: sandbox
  services:
  - config-server

We do not apply a version number suffix on the application name in appsettings.json:

{
    "spring": {
        "application": {
            "name": "appname"
        }
    }
}

We have a yml configuration file called {application}-{environment}.yml (e.g. appname-sandbox.yml).

The issue is that the name of the application in manifest.yml / VCAP_APPLICATION is being used rather than the application name in appsettings.json, by the Steeltoe Configuration libraries, when attempting to locate a yml configuration file.

We have also attempted to explicitly set the application name in code via the Steeltoe.Extensions.Configuration.ConfigServer.ConfigServerConfigurationBuilderExtensions.AddConfigServer(environment, ApplicationName, LogFactory) extension method, but the application name is not propagated properly. The application name from the manifest.yml is still being used.

This behavior seems to be inconsistent with Java Spring Boot.

This looks to be the same, or very similar, to the issue reported at: SteeltoeOSS/Configuration#37

In that same issue it was stated:

I believe the problem you were having with this was that spring.application.name was always being overridden by the name in the manifest.yml when you pushed the app to PCF. This Steeltoe behavior was not consistent with Java Spring Boot applications.

With Java based apps, if you DID NOT configure spring.application.name, then s.a.n would be set to the application name from manifest.yml. If you DID configure s.a.n, then it would be left alone and remain as configured.

With Steeltoe 2.2, to be released by end of 1st Qtr, we no longer override s.a.n when pushing to PCF (i.e. we follow what Java Spring Boot does).

Any idea when this will be fixed?

404 errors on requests to /vault/v1/auth/token/renew-self

Greetings,

I have a .NET Core 2.2 application that is connected - using Steeltoe (release 2.2.0) - to a Spring Cloud Config Server (open source, release 2.1.0) using HashiCorp Vault 1.0.1 as the backend. My app runs in Cloud Foundry. In my app's configuration, I have uri, token, tokenTtl, and tokenRenewRate set.

The application keeps trying to renew the Vault token by posting to /vault/v1/auth/token/renew-self and it gets a 404 every time. I don't see anything in the Spring Cloud Config Server source code that would allow it to handle such a request.

After finding this issue and emailing Craig Walls , I have learned that it is Spring Cloud Services - not the Spring Cloud Config Server - that has a controller that would handle that request.

I'm not sure why Steeltoe thinks my app is connected to Spring Cloud Services. I was under the assumption that Steeltoe was the library to use if I was using a config server and Pivotal.Extensions.Configuration.ConfigServerCore would be the library to use if I was using SCS. Or do both products assume you are using SCS if your app is running in cloud foundry? Is there a way to configure Steeltoe to automatically renew a Vault token if using Spring Cloud Config Server?

Any guidance or suggestions would be greatly appreciated!

Reuse polly

Hi Team,
Is there a way where SteelToe can leverage the complete set of Polly capability. This library is far matured. What I would suggest is a capability to create a wrapper for this project which will allow it to work easily with CF. Polly is a very battle tested old library in .NET. During Lift and shift we see this library used extensively. So this will reduce the migration effort for us.

Fetch registry Object reference not set EurekaPostConfigurer.UpdateWithDefaultsForRoute

  • Using Steeltoe.Discovery.ClientCore Version "2.2.0"
  • Attempting to fetch registry from a .net core 2.2 console app linux x64 on stack cflinuxfs2

When I attempt to resolve IDiscoveryClient type I get the error Object reference not set to an instance of an object. error in Steeltoe.Discovery.Eureka.EurekaPostConfigurer.UpdateWithDefaultsForRoute. The full call stack follows.

2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Steeltoe.Discovery.Eureka.EurekaPostConfigurer.UpdateWithDefaultsForRoute(EurekaServiceInfo si, EurekaInstanceOptions instOptions)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at System.Lazy`1.CreateValue()
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Steeltoe.Discovery.Eureka.EurekaApplicationInfoManager..ctor(IOptionsMonitor`1 instConfig, ILoggerFactory logFactory)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR --- End of stack trace from previous location where exception was thrown ---
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, ServiceProviderEngineScope scope)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Steeltoe.Discovery.Client.DiscoveryServiceCollectionExtensions.<>c.b__12_0(IServiceProvider p)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at RiverFlowProcessor.Startup.UseDiscoveryClient() in C:\Source\Tools\river-flow-processor\consumer\Startup.cs:line 71
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at RiverFlowProcessor.Startup.Configure() in C:\Source\Tools\river-flow-processor\consumer\Startup.cs:line 45
   2019-03-20T20:56:31.52-0700 [APP/PROC/WEB/0] ERR    at RiverFlowProcessor.Program.Main(String[] args) in C:\Source\Tools\river-flow-processor\consumer\Program.cs:line 23

The consumer sample I'm using is at https://github.com/thnk2wn/pcf-river-flow-processor/tree/console-di-svc-reg-use-issue/consumer with Startup and appSettings*.json being the main files of interest (targeting environment Development).

The API side it's attempting to reach is at https://github.com/thnk2wn/pcf-river-flow-processor/tree/console-di-svc-reg-use-issue/api and everything from logging and the Apps Manager service registry dashboard seem to indicate that side is fine.

Using cf env on both consumer and API sides both show p-service-registry set as expected in VCAP_SERVICES.

Locally it seemed to be working okay on the fetch side before but not in my PCF instance.

I've reviewed the samples and tried various things. My use case is slightly different as it is a console app but it is using the built-in DI/IOC like a web app but can't use the webhost specific methods in Steeltoe since it isn't a web app and web references aren't desirable there.

Digging through the code but not quite sure what object is null that it's expecting to be set.

Questions:

  • Ideas to what the problem might be?
  • Can the error handling be improved to offer a better indication of what's not set or what the problem might be?

PCC connector for .NET core application via SteelToe

Hi,
I recently saw an video where a .NET program was able to connect to PCC using Pivotal.GemFire library. Can you please let us if this connectivity will be available as part of SteelToe Connector .NET standard library next release. The problem is I do not see a Pivotal.GemFire .NET standard version.

Missing `.ConfigureAwait(false)` in all await call

Steeltoe assemblies do not have strong name information

When I use nuget package Steeltoe.Extensions.Configuration.CloudFoundry I am getting an error that assembly Steeltoe.Extensions.Configuration.CloudFoundry does not have strong name

CSC : error CS8002: Referenced assembly 'Steeltoe.Extensions.Configuration.CloudFoundry, Version=1.1.1.0, Culture=neutral, PublicKeyToken=null' does not have a strong name.
Yes its optional to sign the C# assemblies. but
but if assemblies are signed it will be useful for consumers who have to work with projects with strong signature.

`IConfigurationBuilder` object not getting `Label` property from `ConfigServerClientSettings`

I'm using Steeltoe for config server reading and discovery. I'm adding the config server info through the ConfigServerClientSettings class and the AddConfigServer() extension method for the Microsoft.Extensions.Configuration.ConfigurationBuilder() class.

Previously I used an appsettings.json file to load all the values required by Steeltoe to connect with the Spring Config Server. It worked perfectly and we could get all our config keys.

However, the team now wants to use the ConfigServerClientSettings class to provide this information. Sadly, when I'm using this class, the Label property is not being read when I build the Configuration. Moreover, after the initialization of the ConfigServerClientSettings class and calling AddConfigServer(...) it's still set.

When I pass through the builder.Build() method I see that the property is set to null. When I inspect the builder variable I see that it has all Spring-related config set properly except for the label.

This is a code snippet that shows this strange behavior.

LoggerFactory loggerFactory = new LoggerFactory();
string configName = "testConfigName";
string configLabel =  "testConfigLabel";
string configUri = "http://localhost:8888";
string configEnv = "testEnv";
var configServerClientSettings = new ConfigServerClientSettings()
{
    Name = configName,
    Label = configLabel,
    Uri = configUri,
    Environment = configEnv,
    Enabled = true,
};

IConfigurationBuilder builder = new Microsoft.Extensions.Configuration.ConfigurationBuilder().AddConfigServer(configServerClientSettings, loggerFactory);

builder.Build();

Do you have any idea what would be causing this issue?

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.