title: Spring cloud config server for plain text files
body: <p>I followed the tutorial for loading plain text files given here : <a href="https://github.com/spring-cloud/spring-cloud-config/blob/master/docs/src/main/asciidoc/spring-cloud-config.adoc#serving-plain-text" rel="nofollow noreferrer">https://github.com/spring-cloud/spring-cloud-config/blob/master/docs/src/main/asciidoc/spring-cloud-config.adoc#serving-plain-text</a></p>
  
  <p>When I test the following url in the config serve it works perfectly and returns the plain text file :
  <a href="http://localhost:8888/icullen-webapp/default/master/messages_en_US.properties" rel="nofollow noreferrer">http://localhost:8888/icullen-webapp/default/master/messages_en_US.properties</a></p>
  
  <p>However when I use in the config client, it takes ages to load my page as I have way too many translations in the same page. The code finds the translations from config repo but for each translation it makes the call to the server and hence its quite slow.</p>
  
  <p>Find below my code :</p>
  
  <pre><code>&lt;bean id="messageSource"
          class="com.icullen.site.utils.TolerantReloadableResourceBundleMessageSource"&gt;
          &lt;property name="basenames" value="http://localhost:8888/icullen-webapp/default/master/messages" /&gt;
          &lt;property name="defaultEncoding" value="UTF-8" /&gt;
          &lt;property name="cacheSeconds"&gt;
              &lt;value&gt;5&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  public class TolerantReloadableResourceBundleMessageSource extends
  ReloadableResourceBundleMessageSource {
  
  private static final Logger logger = LoggerFactory.getLogger(TolerantReloadableResourceBundleMessageSource.class);
  
  @Override
  protected String getMessageInternal(String code, Object[] args,
          Locale locale) {
      String messageInternal = super.getMessageInternal(code, args, locale);
      if(messageInternal == null){
          logger.warn("No translation for : {}", code);
      }
      return messageInternal != null ? messageInternal : "?" + code + "?";
  }
  }
  </code></pre>
  
  <p>The translations are called in the jsp using spring messages like this</p>
  
  <pre><code>&lt;spring:message htmlEscape="true" code="category.${region.name}"/&gt;
  </code></pre>
  
  <p>what am i doing wrong ? what should i do to load the page fast. Please help as we are stuck.</p>