spring-attic / spring-cloud-config-server-mongodb

Apache License 2.0
57 stars 34 forks source link

http://localhost:8080/gateway/prod #4

Open skymans opened 7 years ago

skymans commented 7 years ago

http://localhost:8080/gateway/prod

在浏览器这么访问数据,访问不到,怎么回事呢?

venilnoronha commented 7 years ago

You could access it via http://localhost:8080/master/gateway/prod.properties.

Following are the alternate formats.

Refer to the Documentation for more details.

Does this solve your query?

akashraj05 commented 6 years ago

Hi venilnoronha,

How i can write the client for this. I need to refreash some key in my service using this. I used @RefreshScope for the same but it didn't work.

PFB the code

@RefreshScope @RestController class MessageRestController { @Value("${message:Hello default}") private String message;

@RequestMapping("/message")
String getMessage() {
    return this.message;
}

}

message is not getting refresh automatically in it. How it can be refresh automatically as it gets updated in mongodb

venilnoronha commented 6 years ago

You need to hit the http://HOST:PORT/refresh endpoint to load the updated configuration. Check out the documentation for more details.

akashraj05 commented 6 years ago

So You are saying that i have to refresh it every time i change anything in mongodb. But in git implementation it is getting auto refresh after some time.

venilnoronha commented 6 years ago

Currently, the MongoDB implementation doesn't support the monitoring feature. The Git based implementation relies on a watcher defined in spring-cloud-config-monitor, and therefore, properties are updated as soon as a commit notification is received.

As a workaround, you could use some logic similar to this comment to automatically update properties.

Thanks for bringing this up. I'll do some investigation and see what could be done.