Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

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

Open
skymans opened this issue Nov 1, 2016 · 5 comments
Open

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

skymans opened this issue Nov 1, 2016 · 5 comments

Comments

@skymans
Copy link

skymans commented Nov 1, 2016

http://localhost:8080/gateway/prod

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

@venilnoronha
Copy link
Contributor

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

Following are the alternate formats.

  • /{application}/{profile}[/{label}]
  • /{application}-{profile}.yml
  • /{label}/{application}-{profile}.yml
  • /{application}-{profile}.properties
  • /{label}/{application}-{profile}.properties

Refer to the Documentation for more details.

Does this solve your query?

@akashraj05
Copy link

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
Copy link
Contributor

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

@akashraj05
Copy link

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
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants