Closed marcellodesales closed 9 years ago
Without knowing much about your problem, we don't do anything specific for github. We use jgit for all git communication.
Hi @spencergibb
Thanks for your response... Really appreciated...
Without knowing much about Spring cloud Config, I'd like to know how your APIs know that a certain resource has changed... I understand that jgit is just the client for the content... In other words, are there flags that jgit gives you when a given content has changed... Can you point me to the specifics of your client so that I can investigate?
Our current GitHub Enterprise is not providing the proper ETag output and so there's no way to identify when a given resource changed... I'd like to investigate with you how to properly proceed in case I'm writing an HTTP Client with other language.
thanks a lot Marcello
In short it doesn't know when a resource has changed.
@spencergibb Does it mean Services would be pulling the configuration every time not matter what??? Considering we are living in a Micro-services space, that would mean the configuration is returned at every pulling request... Is that correct?
Considering the HTTP Response Headers ETag
or Last-Modified
are provided, shouldn't those be used?
I'm planning to use Message Queues (AMQP or AWS SNS) to support Async mode of the services. That way, I won't be pulling changes, but listening to the queue topic so that I can asynchronously give services (Java or Node.js) and indication that the Configuration has changed for a given environment.
How would I use ETag
over git ssh?
Hummm... Good point... I did not verify that jgit
uses SSH...
I would think we could add a layer thought it would be pulling metadata through the GitHub API
https://developer.github.com/v3/repos/contents/#get-contents
Then, I would use jgit as it is to pull over ssh if the content has changed... :( I guess that's an extra layer of complexity... But at least it would properly pull whenever the content changes.
I would also think a Git Hook could be used to callback the service to propagate the change to the clients.
Like I said, we need to be compatible with git, not github. We already have an open issue about pushing notifications to clients #86.
@spencergibb Would it be possible to write a connector for GitHub instead of just Git??? We could take advantage of Conditional Requests.
yes, and webhooks.
This is fixed by 8d8e07a78e73c3e1e08f4277a76c6e1a4104f103
@spencergibb... But I don't think that conditional requests are the same as webhooks... But I would think this is a workaround... thanks!
Hi there,
Problem
Hi guys,
I was trying to build the Node.js Client with pulling capabilities against out GitHub server. According to https://developer.github.com/guides/getting-started/#conditional-requests, we can control content caching by using the
ETag
header value from contents.Question
How does the SpringCloud-Config clients make requests to GitHub Enterprise? Do you guys use this feature to identify when a resource has changed? Do you use the
ETag
and/or theLast-Modified
HTTP Response Headers values???Online API works
Here's the example of calling the API online with the proper 304 response.
First Request
I can see the
Second Request
Note that the ETag value did not change.
Third Request
Using "If-None-Match" value. It returned 304 as expected.
Thanks for any help Marcello