小编use*_*027的帖子

spring cloud config:如何使用多个配置

我想尝试一下:

我想尝试spring cloud config微服务项目,我有一个common config所有服务和multiple configs每个服务.
我知道如何使用多个profiles使用spring.profiles.activeinclude.我试图了解如何在配置客户端上加载多个配置?

是)我有的:

在我的git repo中,我有spring-config-repo我所拥有的......

application.yml
orderclient.yml
subscriberclient.yml
jmsclient.yml
productclient.yml
Run Code Online (Sandbox Code Playgroud)

config Server指向我的配置仓库.

spring:
  application:
  name: config-service
  cloud:
   config:
    server:
      git:
        uri: https://github.com/<user>/spring-config-repo

server:
 port: 8888
Run Code Online (Sandbox Code Playgroud)

我有我spring client想要使用多个配置的地方.在我的情况下orderService我想加载application.yml,orderclient.yml,jmsconfig.yml和For Product microService我需要'orderconfig.yml,jmsclient.yml,productclient.yml'

spring:
application:
  name: orderclient
profiles:
  active: test
cloud:
  config:
    uri: http://localhost:8888

###Any kind of config properties to load jmsclient, productclient?
Run Code Online (Sandbox Code Playgroud)

上面我可以从orderclient.yml访问属性.

我的问题:

问题1:

如何访问的性质 …

java microservices spring-cloud-config

7
推荐指数
1
解决办法
7759
查看次数

Spring Cloud zuul网关需要很长时间来服务请求,调整它的最佳实践

我正在将spring-cloud-netflix-zuul网关用于多个服务,当我观察每个应用程序的性能时,appdynamics我发现请求是2 - 23 ms在网关处进行的,并且是在特定服务处处理请求的,但是从网关到服务HTTP正在进行250 - 500 ms,所以只是想知道为什么会这样需要很长时间。我已经浏览了此处找到的文档,并且增加了每个主机最大连接数和总最大连接数,我看到我们正在使用SEMAPHORE并且性能结果很好,它得到了改进,但我

采取的步骤:

  1. 增加了 maxConnectionszuul.host.max-total-connections = 2000
  2. 增加每台主机的最大连接数zuul.host.max-per-route-connections = 500
  3. 使用默认信号量
  4. 增加信号量 - zuul.semaphore.maxSemaphores = 3000

观察结果:

  1. 随着总连接数和每台主机最大连接数的增加,发现 HTTP 时间减少了
  2. 默认或增加或减少到 1 个信号量没有看到任何差异

问题:

  1. 当每个主机的最大连接数为 10 并且网关在这 990 个连接所在的位置收到 1000 个请求时,是否有任何队列需要检查/调试?
  2. 什么时候增加信号量有什么用?
  3. 如何计算每个主机的连接数以设置每个主机的最大连接数以及最大总连接数?
  4. 如何检查我的网关的 IsolationStrategy?我认为它是,"ribbonIsolationStrategy": "SEMAPHORE"但我没有使用功能区/serviceId 概念,我使用的是主机概念,我为所有内容提供zuul.routes主机、路径、url。

gateway spring-cloud netflix-zuul

5
推荐指数
0
解决办法
1734
查看次数

在pcf中部署angular2应用程序

我正在尝试部署我的angular2应用程序,pivotal cloud foundry并按照此处的说明进行操作,但我不断获取Loading...,在开发人员控制台中找不到任何错误.

/d/gitmyworkspace/mywork/pcfdeploy/src
$ npm install --quite
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
/d/gitmyworkspace/mywork/pcfdeploy/src
$ cf push -b staticfile_buildpack ang-pcf-dep
Creating app ang-pcf-dep in org ORG / space development as myDetails...OK
Creating route ang-pcf-dep.domain.com... OK
Binding ang-pcf-dep.domain.com to ang-pcf-dep... OK
Uploading ang-pcf-dep...
Uploading app files from: D:\gitmyworkspace\mywork\pcfdeploy\src
Uploading 12.9K, 18 files Done uploading …
Run Code Online (Sandbox Code Playgroud)

deployment pcf angular

3
推荐指数
1
解决办法
5816
查看次数

如何将漂亮的JSON放入REST api

我试图建立它接受一个REST服务XML并将其转换成JSON并调用它接受外部的服务JSON,把我JSON进去.我能够把json放得很漂亮,但是我想以漂亮的格式把json放进去.请建议怎么做,下面是我的代码......

package com.mypackge

import grails.converters.JSON
import grails.rest.RestfulController
import grails.plugins.rest.client.RestBuilder

class RestCustomerController extends RestfulController {
/*
    static responseFormats = ['json', 'xml']
    RestCustomerController() {
    super(Customer)
    }
*/
    def index() {
        convertXmlToJson()
    }

    def myJson = ''

    def convertXmlToJson() {
    def xml = ''' <Customer>
            <customerid>9999999999999</customerid>
            <ssn>8888</ssn>
            <taxid>8888</taxid>
            <address>
                            <addressline1>Yamber Ln</addressline1>
                            <addressline1>8664 SE</addressline1>
                            <city>CCCCC</city>
                            <state>CC</state>
                            <zipcode>97679</zipcode>
            </address>
            <firstname>Scott</firstname>
            <middlename></middlename>
            <lastname>David</lastname>
            <account>
                                            <accountno>576-294738943</accountno>
                                            <accounttype>Lease</accounttype>
                                            <accountsubtype></accountsubtype>
                                            <accountstatus>complete</accountstatus>
                                            <firstname>Scott</firstname>
                                            <middlename></middlename>
                                            <lastname>David</lastname>
                                            <businessname></businessname>
                                            <billingsystem>yoiuhn</billingsystem>
                                            <brand></brand>
                                            <plantype></plantype>
                                            <billingaddress>
                                                            <addressline1>Yamber Ln</addressline1> …
Run Code Online (Sandbox Code Playgroud)

rest grails json web-services

2
推荐指数
1
解决办法
360
查看次数