consul-discovery | CONSUL service discovery for PHP | Configuration Management library
kandi X-RAY | consul-discovery Summary
kandi X-RAY | consul-discovery Summary
CONSUL service discovery for PHP
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Make a GET request
- Get a service .
- Get the json decoded response
- Get HTTP status code
- Get the service ID .
- Set the service ID
- Get port .
- Sets the port
consul-discovery Key Features
consul-discovery Examples and Code Snippets
use Zumba\Consul\Features\Discovery;
$discovery = new Discovery([
"consul_url" => "YOUR_CONSUL_HTTP_API"
]);
$service = $discovery->getService("pigeon");
echo $service->getID();
echo $service->getAddress();
echo $service->getPort()
Community Discussions
Trending Discussions on consul-discovery
QUESTION
I'm currently working on a microservices application for my internship using Consul for service discovery and feign clients for communicating between the services. When we started working on the existing project which already was built using microservices, we upgraded Spring boot to 2.4.3 & cloud to 2020.0.1, so that we could make use of Java 15 to use records instead of normal classes for dtos. The problem we have now is that, whenever we make a call to a composite service, that will try to retrieve data from multiple services (for example users and teams service), that we get the following stacktrace:
...ANSWER
Answered 2021-Jun-04 at 07:23Can you try excluding ribbon dependency as shown below
QUESTION
I am trying to add "Service Discovery" using consul in my Spring Boot (Maven) application but unable to use @EnableDiscoveryClient. Since, I am new to Intellij I am not sure what I am missing.
Added pom.
I did the following:
- Added consul dependency in my pom.xml
ANSWER
Answered 2020-Apr-06 at 05:06You have't specified artifact version for spring-cloud-starter-consul-discovery
.
NOTE: you didn't have to specify versions for Spring Boot artifacts, because the parent pom has dependency for them. Consul starter is part of Spring Cloud and Spring Cloud version needs to be managed separately
There are 2 ways to do it
- directly in dependency, via
version
tag - in
dependencyManagement
tag
I encourage you to take the latter approach, Spring provides an include with all Spring Cloud dependencies in compatible version. To do it:
- Add
Hoxton.SR3
in - Add the following in
dependencyManagement
QUESTION
I am using Spring Boot including Spring 2.1.2 Release Security and using KeyCloak Oauth2.0. But when I restart the application I got the following error.
Parameter 0 of method tokenRelayGatewayFilterFactory in org.springframework.cloud.security.oauth2.gateway.TokenRelayAutoConfiguration required a bean of type 'org.springframework.security.oauth2.client.web.server.ServerOAuth2AuthorizedClientRepository' that could not be found.
...ANSWER
Answered 2020-Mar-27 at 13:22You are using Reactive Spring modules (WebFlux, Spring-Cloud-Gateway). So, the security configuration cannot be traditional way. You need to setup your security configuration like below;
QUESTION
I am using spring cloud gateway as API gateway in my micro service setup with consul as service discovery.
In some case when API of some microservice take more then 2 minutes, gateway throws below error:
...ANSWER
Answered 2019-May-27 at 14:06There was an issue in downstream service.
In my application, there is nodejs application is running behind the spring cloud gateway and default time out is 2 min.
Ref: https://github.com/expressjs/express/issues/3330
In my case after 2 min, nodejs application gives timeout and that is why I get an error in the gateway.
I resolved it by changing timeout values in node application
QUESTION
We are using Spring Cloud Gateway before multiple microservices with consul as service discovery. There are several microservices developed in different languages.
Please find build.gradle for the application
...ANSWER
Answered 2019-Feb-14 at 21:05A number of things were needed
- disable http2
- Disable ssl configuration of httpclient
- Update
locator
predicates and filters to use verbose configuration.
Here is the resulting portions of application.yml
QUESTION
I am learning spring cloud with consul as service discovery implementation, I followed a tutorial on internet. I am using eclipse and maven. The pom file is generated by Spring Initializr. From spring official documentation, they says "@EnableDiscoveryClient" is no more needed, so I commented it, but with this annoatation makes no difference.
my code is below:
...ANSWER
Answered 2018-Oct-21 at 11:04Tried to launch application with your pom.xml
. It fails with next message:
QUESTION
I have got a very simple junit suite as follows:
...ANSWER
Answered 2017-Jun-10 at 04:12@DataMongoTest
disables autoconfiguration, so the test binder configuration is not picked up.
To get the test binder working, you can try adding its autoconfiguration to your test via:
@ImportAutoConfiguration(org.springframework.cloud.stream.test.binder.TestSupportBinderAutoConfiguration.class)
QUESTION
We are trying to build a microservice with nodejs in an environment with other microservices written in java/spring boot.
The other microservices are using consul.io for service discovery and ribbon for client side load balancing. (that would be: spring-boot, spring-cloud-starter-consul-discovery, spring-cloud-starter-feign and spring-cloud-starter-ribbon projects)
Now in this mix, we have a consul node module to register or discover services, but what of rest of the things? How do I do a discovery-aware rest call with a load balancing handled on the client, similar to that of ribbon.
How can I achieve this in node's stack?
...ANSWER
Answered 2017-Jun-29 at 17:00Is this any use? https://www.npmjs.com/package/resilient
It says: Resilient is conceptually similar to Ribbon, a Netflix's project.
QUESTION
I wanted to setup an example for New in Spring 5: Functial Web Framework
So I set up a RouteConfiguration
:
ANSWER
Answered 2017-Aug-25 at 08:02Reading the comments, it seems this was an issue with dependencies bringing spring-boot-starter-web
; if it is present, a Spring MVC application is started by Spring Boot.
There's a way to explicitly tell Spring Boot the type of the application, in the main Application class:
QUESTION
I am creating a Spring Boot
application, which will read configuration like DB properties from Consul
. But I am not able to read the key value from Consul using my application. Following is, what I am trying to do.
ANSWER
Answered 2017-Dec-15 at 19:12You can find a working example here.
Consul Configuration KV StoreYou need to store your properties in the Consul KV store either from Consul UI or from the command line. The Consul Agent will not load your properties from the file system. To load the properties from the command line, you can use the following command once the Consul Agent is up and running. The YAML data can be read from a file by prefixing the file name with the @ symbol.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install consul-discovery
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page