我想尝试spring cloud config微服务项目,我有一个common config所有服务和multiple configs每个服务.
我知道如何使用多个profiles使用spring.profiles.active和include.我试图了解如何在配置客户端上加载多个配置?
在我的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访问属性.
如何访问的性质 …
我正在将spring-cloud-netflix-zuul网关用于多个服务,当我观察每个应用程序的性能时,appdynamics我发现请求是2 - 23 ms在网关处进行的,并且是在特定服务处处理请求的,但是从网关到服务HTTP正在进行250 - 500 ms,所以只是想知道为什么会这样需要很长时间。我已经浏览了此处找到的文档,并且增加了每个主机最大连接数和总最大连接数,我看到我们正在使用SEMAPHORE并且性能结果很好,它得到了改进,但我
采取的步骤:
zuul.host.max-total-connections = 2000zuul.host.max-per-route-connections = 500观察结果:
问题:
"ribbonIsolationStrategy": "SEMAPHORE"但我没有使用功能区/serviceId 概念,我使用的是主机概念,我为所有内容提供zuul.routes主机、路径、url。我正在尝试部署我的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) 我试图建立它接受一个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) angular ×1
deployment ×1
gateway ×1
grails ×1
java ×1
json ×1
netflix-zuul ×1
pcf ×1
rest ×1
spring-cloud ×1
web-services ×1