我已经在Eureka服务器中注册了UI和后端应用程序。它已经启动并正在运行(均为应用程序)。配置zuul application.yml:
my app level gradle is
android {
compileSdkVersion 27
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.sample.mvvmandroidstudio"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-
layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-
core:3.0.2'
}
stacktrace以下;
zuul:
sensitive-headers:
ignore-security-headers: false
routes:
complexitycheck:
path: /api/app1/**
serviceId: APP1
strip-prefix: true`
application.properties: `eureka.instance.preferIpAddress=true
eureka.client.registerWithEureka=true eureka.client.fetchRegistry=true
eureka.instance.hostName=App1 eureka.client.serviceUrl.defaultZone=http://eureka_host/eureka/
hystrix.command.default.execution.timeout.enabled=true
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=60000
答案 0 :(得分:0)
当我使用相同的Zuulserver在localhost和DEV环境上开发微服务时(当我在localhost上启动microservis时,它连接到DEV env上的zullserver),此问题在我的项目上发生。然后,当我尝试通过zuulserver调用某些操作时,它尝试连接到不在DEV env上的microservis。但在我的机器上。
我怀疑您这边的问题以及正在开发应用程序的IP是192.168.1.35:8282。