steeltoeoss / samples Goto Github PK
View Code? Open in Web Editor NEWSteeltoe samples and reference application collection
Home Page: https://steeltoe.io/
License: Apache License 2.0
Steeltoe samples and reference application collection
Home Page: https://steeltoe.io/
License: Apache License 2.0
This samples are great, but is there any tutorial available to start from scratch. There is code related to service discovery and client that needs to be written in many files like program.cs, startup.cs, appsettings.json, package.json and manifest.yml.
I am able to write services but i am not sure what are all the changes i need to make in my code in order to register it into Spring Cloud Eureka Server.
This page:
https://github.com/SteeltoeOSS/Samples/tree/dev/Connectors/src/AspDotNet4/MsSql4
has a link to the connector source but it returns a 404.
In the Sample CI pipeline, steps to setup services are associated with timeouts. If a timeout is exceeded, the setup is considered to have failed. The intent of the implementation was to prevent a step for running ad infinitum.
The cleanup phase assumes that any services that are found are in a "started" state. In the scenario, described above, the service will likely be in a "setting up" state. The cleanup phase does not handle such states and fails, thus leaving the service and its space behind, forcing manual cleanup.
I have created a service registry and bound a service successfully. This may not be a issue, but I cannot consume application name to get the records. "http://csi-contactservice.cfapps.io/api/values" is working properly, but "http://csi-contactservice/api/values" doesn't work. Do I need to config DNS or what is the proper way of consuming a service-registry.
Getting this error on startup:
Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. (Device not configured) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: Device not configured
at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
at System.Net.Dns.ResolveCallback(Object context)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult)
at System.Net.Dns.EndGetHostAddresses(IAsyncResult asyncResult)
at System.Net.Dns.<>c.<GetHostAddressesAsync>b__25_1(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Steeltoe.Discovery.Eureka.EurekaInstanceConfig.GetHostAddress(Boolean refresh)
at Steeltoe.Discovery.Eureka.EurekaInstanceConfig..ctor()
I did the investigation and tracked it down to https://github.com/dotnet/corefx/issues/13309 .
Workaround
Get current hostname and add it to the /etc/hosts
file.
Posted an issue here to check if this call can be removed from eureka client.
Hi
When I run two instances of fortuneteller service. it keeps registring port 5000 (from appsettings) instead of the port mentioned in server.urls on run. any ideas?
I am trying to push the application using pushShoppingCartService.cmd win7-x64 netcoreapp1.1, but I get the following error: 'Stack windows2012R2 not found'. How do I add this stack?
Update the Project to be based on ASP.Net Core 2.1.X Templates
This version of the Samples repository
Samples/Configuration/src/AspDotNetCore/CloudFoundry master ✓ git --no-pager log -n1
commit f039eedf737beecfe0e784bde8d4e207cf9eed58 (HEAD -> master, origin/master)
Author: Chris Cheetham <[email protected]>
Date: Mon Jul 8 14:45:35 2019 -0400
fix behave arg
I cf push cloud-test --random-route
in the Configuration/src/AspDotNetCore/CloudFoundry
directory
The dotnet-core_buildpack-cflinuxfs3-v2.2.12.zip
buildpack from upstream cf and this cf version:
$ cf api
api endpoint: https://api.fr.cloud.gov
api version: 2.138.0
I see these errors
Pushing from manifest to org <redacted> / space <redacted> as [email protected]...
Using manifest file /Users/<redacted>/Development/dotnet/Samples/Configuration/src/AspDotNetCore/CloudFoundry/manifest.yml
Getting app info...
Updating app with these attributes...
name: cloud-test
path: /Users/<redacted>/Development/dotnet/Samples/Configuration/src/AspDotNetCore/CloudFoundry
buildpacks:
dotnet_core_buildpack
disk quota: 1G
health check type: port
instances: 1
memory: 512M
stack: cflinuxfs3
env:
ASPNETCORE_ENVIRONMENT
routes:
<redacted>
Updating app cloud-test...
Mapping routes...
Comparing local files to remote cache...
Packaging files to upload...
Uploading files...
201.22 KiB / 201.22 KiB [=============================================================================================================================================================================] 100.00% 1s
Waiting for API to complete processing files...
Staging app and tracing logs...
Downloading dotnet_core_buildpack...
Downloaded dotnet_core_buildpack
Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 creating container for instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 successfully created container for instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
Downloading app package...
Downloaded app package (606.5K)
-----> Dotnet-Core Buildpack version 2.2.12
-----> Supplying Dotnet Core
-----> Installing libunwind 1.3.1
Download [https://buildpacks.cloudfoundry.org/dependencies/libunwind/libunwind-1.3.1-cflinuxfs3-96d2f3d0.tar.gz]
using the default SDK
-----> Installing dotnet-sdk 2.2.204
Download [https://buildpacks.cloudfoundry.org/dependencies/dotnet-sdk/dotnet-sdk.2.2.204.linux-amd64-cflinuxfs3-3278b7aa.tar.xz]
-----> Installing dotnet-runtime 2.2.5
Download [https://buildpacks.cloudfoundry.org/dependencies/dotnet-runtime/dotnet-runtime.2.2.5.linux-amd64-cflinuxfs3-45a01508.tar.xz]
-----> Finalizing Dotnet Core
**ERROR** Unable to install dotnet-runtime: could not find a version of dotnet-runtime to install
Failed to compile droplet: Failed to run finalize script: exit status 12
Exit status 223
Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 stopping instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
Cell 5141b1ca-9fb7-4cfd-bc81-1661301ce2b7 destroying container for instance 95b3650f-ad5a-4f37-b5ab-6b8a7e8acc07
Error staging application: App staging failed in the buildpack compile phase
FAILED
Currently, our UAA sample on works on CF. It would be beneficial to have a sample for local development also.
Hi,
We are planning to use the new container to container network feature of cloud foundry. Our Back end services has more than one instance and we need a way to load balance between these containers from the front end application. Spring cloud has the capability of Ribbon load balancer. However I could not see a sample where the same could be used with asp.net core application. So could you please let me know how to use Ribbon load balancer (or equivalent) with .NET core
Hi I'm trying to integrate Steeltoe to my .netcore application. The application connects to an Oracle db and fetches a few records for processing. While debugging locally, my app is opening the below json file when i execute the connection.Open() line. Once I open the json file, the debugging in VS gets stopped while the app continues to run.
I'm using the below packages:
<PackageReference Include="Steeltoe.Extensions.Configuration.CloudFoundryCore" Version="2.1.1" />
<PackageReference Include="Steeltoe.Management.CloudFoundryCore" Version="2.1.1" />
<PackageReference Include="steeltoe.management.tracingcore" Version="2.1.1" />
What am I missing?
S04W8QRC.txt
Program.cs file:
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseHealthChecks("/health") // Healthcheck route
.UseStartup<Startup>()
.UseSerilog()
.UseCloudFoundryHosting()
.ConfigureAppConfiguration((builderContext, config) =>
{
config.AddCloudFoundry()
.AddEnvironmentVariables();
})
.ConfigureLogging((builderContext, logging) =>
{
logging.AddDynamicConsole();
});
Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false);
//Zipkin integration using Steeltoe
services.AddCloudFoundryActuators(Configuration);
services.AddDistributedTracing(Configuration);
// Add Steeltoe Cloud Foundry Options to service container
services.ConfigureCloudFoundryOptions(Configuration);
services.AddCors();
....
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
var configSettings = app.ApplicationServices.GetRequiredService<IConfigSettings>();
// if its in PCF forward it.
if (configSettings.EnvironmentName != "Development")
{
app.UseForwardedHeaders(new ForwardedHeadersOptions()
{
ForwardedHeaders = ForwardedHeaders.XForwardedProto
});
}
app.UseCloudFoundryActuators();
app.UseCors(
options => options
.AllowAnyMethod()
.AllowAnyHeader()
.AllowAnyOrigin()
);
...
Hello all,
I followed the document to run circuit breaker sample. When I input the url http://localhost:5555/hystrix/hystrix.steeam and click Monitor Stream, the dashboard show "Unable to connect to Command Metric Stream."
some messages show in the log
in Fortune-Teller-UI:
fail: Steeltoe.CircuitBreaker.Hystrix.MetricsStream.HystrixMetricsStreamPublisher[0]
Error sending metrics to Hystrix dashboard, metrics streaming disabled: RabbitMQ.Client.Exceptions.AlreadyClosedException: Already closed: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=404, text="NOT_FOUND - no exchange 'spring.cloud.hystrix.stream' in vhost '/'", classId=60, methodId=40, cause=
at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)
at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, Byte[] body)
at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)
at Steeltoe.CircuitBreaker.Hystrix.MetricsStream.HystrixMetricsStreamPublisher.<StartMetricsPublishing>b__11_0(List`1 jsonList)
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Request starting HTTP/1.1 GET http://localhost:5555/hystrix/hystrix.stream
info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Request finished in 253.0019ms 404
In Hystrix Dashboard log
Proxy opening connection to: http://localhost:5555/hystrix/hystrix.stream
2018-01-09 16:10:03.667 WARN 22780 --- [nio-7979-exec-3] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:5555/hystrix/hystrix.stream : 404 : HTTP/1.1 404 Not Found
2018-01-09 16:10:03.667 WARN 22780 --- [nio-7979-exec-2] ashboardConfiguration$ProxyStreamServlet : Failed opening connection to http://localhost:5555/hystrix/hystrix.stream : 404 : HTTP/1.1 404 Not Found
It seems dashboard can't find endpoint in the Fortune-Teller-UI.
How could I solve it?
Thanks!
Not able to get data from Repository. (Using Asp.Net.core) I have create the
Service Config
Push to PCF.
Able to browse the page but not getting any value from Repository. Please help us
Or
There have any way to do locally ?
spring.cloud.inetutils.preferredNetworks[0]=^192.168
spring.cloud.inetutils.ignored-interfaces[0]=eth0
or
"cloud": {
"inetutils": {
"preferredNetworks": [ "^192" ]
}
}
The above some lines did not worded
Can you help for it ?
Hello,
I have an existing web api project(dotnet core 2.0.7) which connects to Config Server and fetches data. I updated my project (dotnet core 2.1.0), and since then i am unable to fetch data from config server.
I only did the following changes to my project
.csproj
Earlier
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.7" />
<PackageReference Include="Pivotal.Extensions.Configuration.ConfigServerCore" Version="2.0.0" />
</ItemGroup>
Now
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.1.0" />
<PackageReference Include="Pivotal.Extensions.Configuration.ConfigServerCore" Version="2.1.0" />
</ItemGroup>
Can you please help
When deploying these samples to PCF using the included manifest files, this warning shows up:
Use of 'buildpack' attribute in manifest is deprecated in favor of 'buildpacks'. Please see http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html#deprecated for alternatives and other app manifest deprecations. This feature will be removed in the future.
Update manifests to use the new format
I followed this tutorial Using Steeltoe Docker images
https://github.com/SteeltoeOSS/Samples/tree/master/MusicStore. Login in,MusicList,AddCart all work ok.But when submit order,I get something like this:
When running Management sample or using Steeltoe.Management.CloudFoundry
to enable Actuator endpoints Server returns the following error.
{
"security_error": "Application id is not available"
}
I think the reason is when running locally ICloudFoundryOptions.ApplicationId is set to null. Not sure how to set it correctly.
Hi,
The security samples shows that one could configure CloudFoundryAuthentication options within the appsettings.json, however all examples only show a small snippet of what it is supposed to look like. I tried adding a few other options but doesn't seem to work since the schema doesn't closely match CloudFoundryOptions class and i couldn't find the piece of code that applies those settings from the source code.
"security": {
"oauth2": {
"client": {
"validate_certificates": false
}
}
},
Could you please better document the full set of settings options available or point me to how you actually load these settings?
how to access '@GetAntiXsrfRequestToken()' from external js file?
Hi,
I have Eureka running on Ubuntu like this:
But, every when I try to fetch Registry from Eureka, error occurs like this:
Attached to Visual Studio with pulled code from github, exception's thrown from:
This is result from POSTMAN:
Please have a look and let me know what's wrong with me.
Thanks a lot,
We have decided to not include security out of the box for actuator following https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html#production-ready-endpoints-security but there are frequently questions about how to secure endpoints.
When I access to Vcap Services in my dotnet core app using your Samples/Configuration/src/AspDotNetCore/CloudFoundry, I see mongodb key and I can navigate to credentials subkey, but uri is empty.
{
"mongodb": [
{
"credentials": {
"uri"
},
"label": "mongodb",
"name": "app_name",
"plan": "default",
"tags": [
"mongodb",
"document"
]
}
]
}
If I run "cf env app_name" the uri has content.
Thank you
Hi,
Do you guys have an ETA for ASP.NET Core 2.0 support?
I've been able to get some of the Steeltoe components to work, but it seems 2.0 has introduced a few breaking changes...
Thanks,
René
Hi,
Forgive me for what may sound like a newbie question, venturing off into unknown territory...
I need to get SSO working at my org and am going through the CloudFoundrySingleSignon sample. This looks odd: (credentials.json file)
{
"client_id": "myTestApp",
"client_secret": "myTestApp",
"uri": "uaa://login."
}
Storing credentials is source control is a big no no... any alternate way to do this?
Thanks,
Rene
Now that the SSO tile has an API, we may be able to script the setup for any samples that use it https://docs.pivotal.io/p-identity/sso-api/#introduction
I'm new to hystrix and all examples i see use a service interface and implementation where the implementation inherits from the HystrixCommand class.
From what i see it's also possible to instantiate the command when needed and pass an anonymous method to it.
Is it considered a bad practice to use it this way ? Or is this just because most examples are implemented using the inheritance way ?
Thanks.
I am integrating Steeltoe Eureka in our project and for creating high availability servers I need to have multiple Serviceurl keys (eureka endpoints) in my configuration. Could you please help me to solve thing thing out.
eShopOnContainers is Great Sample Code reference for working with Microservices and Containers with .Net Core Created by Microsoft , that a lot of .Net developers consider as the Only mature reference for working with Microservices and containers in .Net Core.
I Think it will be a Great idea to Fork this Repo and Create based on it a Sample that Utilize all Steeltoe Great Features in one Project and even Replace the "musicStore" Sample with this eShopOnContainers.
Most of .Net developers now consider eShopOnContainers a Reference for Microservices, and it will be much easier for them to take a look at Steeltoe features and take a look and even compare them with the original project.
From the README at: https://github.com/SteeltoeOSS/Samples/blob/master/Configuration/src/AspDotNet4/Simple/README.md
Step 5 in the Pre-Requisites section (mvn spring-boot:run) does not work for me. When executing that step I was getting the following exception:
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.7.RELEASE:run (default-cli) on proj ect spring-cloud-config-server: An exception occurred while running. null: InvocationTargetException: Error creating bea n with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfigura tion$Tomcat.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInst antiationException: Failed to instantiate [org.apache.tomcat.jdbc.pool.DataSource]: Factory method 'dataSource' threw ex ception; nested exception is org.springframework.boot.autoconfigure.jdbc.DataSourceProperties$DataSourceBeanCreationExce ption: Cannot determine embedded database driver class for database type NONE. If you want an embedded database please p ut a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need t o active it (no profiles are currently active). -> [Help 1]
I was able to get it working by commenting out lines 25-29 from the pom.xml file at: https://github.com/spring-cloud/spring-cloud-config/tree/master/spring-cloud-config-server
<!--<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> <optional>true</optional> </dependency>-->
Once I did this, the mvn spring-boot:run command completed successfully.
Hi. I have been trying to create a working example of a .NET console application that will perform service discovery to a Service Registry (Eureka) deployed in PCF. We are architecting a solution that has "processors" that need to discover services. These processors are console applications.
I was leveraging an existing example found at
https://github.com/SteeltoeOSS/Samples/tree/dev/Discovery/src/Console
However I can't get it working in PCF.
The binding of the configuration to the EurkaClientConfig does not seen to fully work.
var clientConfig = new EurekaClientConfig();
ConfigurationBinder.Bind(configuration.GetSection("eureka:client"), clientConfig);
The appsettings.json in the sample app has a setting called eureka:client:serviceUrl. The ErrekaClientConfig class has a setting called EurekaServerServiceUrls. So the service URL does not get populated from appsettings.json. From the sample, it is a coincidence that they are the same URL ("http://localhost:8761/eureka/") after the configuration binding. So this sample may work with a locally running Eureka Discovery Sevrice, but not on PCF using the configuration in appsettings.json.
Even when I manually set the EurekaServerServiceUrls with the URL of the deployed Service Registry, it does not work despite having a registered application. I wonder if I need to use Service Key Credentials such as eureka:client:clientId, and eureka:client:clientSecret which I have set up in PCF for the Service Registry. However I have no idea to get these credentials into the ErrekaClientConfig in the sample console application.
I have a running instance of Eureka 1.7.0 running on Tomcat 8.5, when I surf to Eureka the management screen is working fine. I downloaded the Eureka directly from Netflix OSS.
When I try to connect with a simple ASP.NET Core Web API project it does not work. I get the following error in the output screen: "Steeltoe.Discovery.Eureka.DiscoveryClient:Error: HeartBeat failed"
Is there a way to get more info about why the heartbeat failed? or is steeltoe not compatible with Eureka 1.7.0?
This is my appsettings.json:
{ "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Information", "Pivotal": "Debug", "Steeltoe": "Information" } }, "spring": { "application": { "name": "EurekaDiscoveryService" } }, "eureka": { "client": { "serviceUrl": "http://localhost:8080/", "shouldFetchRegistry": false }, "instance": { "port": 50612 } } }
I get an error when I execute this command. I have tested on .netcoreapp 2.0 as well as 1.1. Is this a kind of VS error? I cannot even build the project using VS 2017. I have pulled out the dev branch for this development.
Without building the project I have tried out to push to the cloud foundry by using "cf push" and still get the common error as BuildpackCompileFailed.
The provided example use an MVC action to handle the RabbitMQ messages, it can only deal with one message when the action is invoked.
I think I need a service like window service to handle the messages in schedule, but there is not window service in .net core.
If I use the console application, maybe I can not use the services or middleware as there is no startup class, that means I can not use the steeltoe interfaces.
If I use the web application, I am not sure when or where to start listening.
Could you please provide some solutions or samples?
Hi,
Using Pivotal SSO Service for authenticating and authorizing the users in .NET App. SSO Service is configured with external Ping Identity provider and SAML metadata is configured to make SSO service work. Authentication is working fine as expected using Authorization code from Steeltoe sample, but somehow group membership from SAML attributes are not getting properly mapped to scopes and hence policy claim is failing in .NET App.
Could someone help me in mapping ping identity groups to UAA scopes and additional configuration that needs to be configured in p-identity in order to authorize using [Authorize(Policy = "xyz")] in .NET App.
Regards
Mahesh
Hi pals, I am going to run the discovery project. The service (fortuneService) gets registered in the Eureka, but when running the UI project, it cannot find the Random method in FortunesController ("http://fortuneService/api/fortunes/random").
I have also checked the "http://fortuneService/api/fortunes/random" in Postman and it does not find the endpoint either!
Could you please help me with the problem?
I am using the unmodified sample and it works locally but when I push to PCF the service lookup doesn't return the actual route. It's looking up https://fortuneservice/api/fortunes/random which the service lookup should return https://fortuneservice.apps.cloud.wonderboxsystem.com/api/fortunes/random.
Any ideas what could be wrong??
2018-05-11T07:46:28.785-05:00 [APP/PROC/WEB/0] [OUT] dbug: Steeltoe.Common.Discovery.DiscoveryHttpClientHandler[0]
2018-05-11T07:46:28.785-05:00 [APP/PROC/WEB/0] [OUT] LookupService(https://fortuneservice/api/fortunes/random)
2018-05-11T07:46:28.785-05:00 [APP/PROC/WEB/0] [OUT] LookupService() returning https://fortuneservice/api/fortunes/random
In the process of understanding Cloud Foundry ConfigServer provider as github, We are following configuration example the problem here is we are not able to see the values for 'Config Server Data' section.
All the values under that particular section has ;Not Returned' value.
Can you help us what we are doing wrong/going wrong. And what are the steps we can check to make it work.
Note: I deployed to PCF with 'configserviceapp' name.
Example followed: samples/Configuration
How do I use "UseDiscoveryClient()" in a .net core console application?
A console application does not have IApplicationBuilder or middleware to call this method directly.
I get the following error when attempting to start up a simple Steeltoe client:
fail: Steeltoe.Discovery.Eureka.Transport.EurekaHttpClient[0]
RegisterAsync Exception:
fail: Steeltoe.Discovery.Eureka.DiscoveryClient[0]
Register failed, Exception: System.PlatformNotSupportedException: The libcurl library in use (7.51.0) and its SSL backend ("SecureTransport") do not support custom handling of certificates. A libcurl built with OpenSSL is required.
I am using .NET 1.0.1 tools and .NET 1.1 runtime.
Guys, I really don't know if this is the right place to open this issue, but, when I was trying to pull the docker image, docker cli threws an exception telling that manifest for tag "latest" was not found. Can anyone help me? Thanks.
public class ClientServiceCommand : HystrixCommand<string>
{
IClientService _clientService;
ILogger<ClientServiceCommand> _logger;
private int _clientId;
public ClientServiceCommand(IHystrixCommandOptions options, IClientService clientService,
ILogger<ClientServiceCommand> logger) : base(options)
{
_clientService = clientService;
_logger = logger;
IsFallbackUserDefined = true;
}
public async Task<string> GetClientName(int clientId)
{
_clientId = clientId;
return await ExecuteAsync();
}
protected override async Task<string> RunAsync()
{
var result = await _clientService.GetClientName(_clientId);
_logger.LogInformation("Run: {0}", result);
return result;
}
protected override async Task<string> RunFallbackAsync()
{
_logger.LogInformation("RunFallback");
return await Task.FromResult("Sorry, the service is unavaliable now. Please try again later.");
}
}
Can you please help to advise?
I've been testing out /Samples/Management/src/AspDotNetCore/Tracing/Fortune* project and Steeltoe has some pretty slick features. I was using the Zipkin Trace Exporter to send spans to a Zipkin server and everything worked as described (Awesome). However, I have a need to export these spans to a Jaeger server now (Written in Golang). Jaeger is supposed to be backwards compatible with Zipkin so this should not be a problem. But when I send traces to my Jaeger server I consistently receive a 400 Bad Request.
After digging a little deeper, it appears to happen when the Jaeger server is trying to parse the json body of trace information. Specifically, it looks like it is having trouble parsing "IPv6":null. According to the Zipkin documentation, IPv6 should be absent if unknown. So I tried sending an identical trace, but instead of IPv6 equaling null, IPv6 was absent. This seems to work.
Should IPv6 be present at all- if unkown? Does this sound like a Steeltoe problem? Is there a way to control the trace JSON that is sent when exporting traces?
Fortune-Teller-UI> fail: Steeltoe.CircuitBreaker.Hystrix.MetricsStream.HystrixMetricsStreamPublisher[0] Fortune-Teller-UI> Error creating connection/channel, metrics streaming disabled: RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: 由于目标计算机积极拒绝,无法连接。 127.0.0.1:5672 Fortune-Teller-UI> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Fortune-Teller-UI> at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) Fortune-Teller-UI> at System.Net.Sockets.Socket.<>c.<ConnectAsync>b__267_0(IAsyncResult iar) Fortune-Teller-UI> --- End of stack trace from previous location where exception was thrown --- Fortune-Teller-UI> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Fortune-Teller-UI> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Fortune-Teller-UI> at RabbitMQ.Client.TcpClientAdapter.<ConnectAsync>d__2.MoveNext() Fortune-Teller-UI> --- End of stack trace from previous location where exception was thrown --- Fortune-Teller-UI> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Fortune-Teller-UI> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Fortune-Teller-UI> at RabbitMQ.Client.Impl.TaskExtensions.<TimeoutAfter>d__0.MoveNext() Fortune-Teller-UI> --- End of stack trace from previous location where exception was thrown --- Fortune-Teller-UI> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() Fortune-Teller-UI> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Fortune-Teller-UI> at RabbitMQ.Client.Impl.SocketFrameHandler.Connect(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout) Fortune-Teller-UI> --- End of inner exception stack trace --- Fortune-Teller-UI> at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func
2 selector)
Fortune-Teller-UI> at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
Fortune-Teller-UI> --- End of inner exception stack trace ---
Fortune-Teller-UI> at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
Fortune-Teller-UI> at Steeltoe.CircuitBreaker.Hystrix.MetricsStream.HystrixMetricsStreamPublisher.SetupConnection()`
Distributed transaction
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.