0Pricing
Spring Boot 4 Microservices & REST APIs · Ders

Çalışma Zamanında Yapılandırmayı Yenileme

Hizmetleri yeniden başlatmadan yapılandırmayı güncelleyin.

Çalışma Zamanında Yapılandırmayı Yenileme, CoddyKit'te ücretsiz bir Spring Boot 4 Microservices & REST APIs dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Spring Boot 4 Microservices & REST APIs öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Spring Boot 4 Microservices & REST APIs kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Config changes without restarts

By default clients read config only at startup. To apply a changed value without restarting, Spring Cloud provides runtime refresh.

The Actuator refresh endpoint

Add Spring Boot Actuator and expose the refresh endpoint. Posting to it makes the client re-fetch config from the server.

management:
  endpoints:
    web:
      exposure:
        include: refresh

Triggering a refresh

A POST to /actuator/refresh reloads the environment and returns the list of changed property keys.

// POST http://localhost:8080/actuator/refresh
// response: ["app.greeting"]   <- keys that changed

@RefreshScope

Only beans annotated with @RefreshScope are re-created on refresh, picking up new values. Without it, a bean keeps the value it got at startup.

@RefreshScope
@Component
public class GreetingService {
    @Value("${app.greeting}")
    private String greeting; // updates after /actuator/refresh
}

What gets updated

On refresh, @ConfigurationProperties beans are rebound automatically (no @RefreshScope needed), while @Value-based beans need @RefreshScope to see new values.

How @RefreshScope works

@RefreshScope wraps the bean in a proxy. On refresh the underlying instance is discarded and lazily re-created on next use, so it reads fresh config.

Refresh is per-instance

Calling /actuator/refresh updates only that one instance. In a cluster you must hit every instance - which does not scale well.

Spring Cloud Bus

Spring Cloud Bus links instances over a message broker (RabbitMQ/Kafka). A single /actuator/busrefresh then broadcasts the refresh to all instances at once.

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-bus-amqp</artifactId>
</dependency>

Automating with webhooks

Connect your Git provider's webhook to the Config Server's monitor endpoint so a push automatically triggers a bus refresh across the fleet - no manual call needed.

What cannot be refreshed live

Some settings only take effect at boot - e.g. server port, datasource URL for an already-built pool, or component scanning. Changing those still requires a restart.

Refresh safely

Treat refresh like a deploy: validate config in Git first, roll out gradually, and watch the returned changed-keys list to confirm only intended values changed.

Quick Check

Test your runtime-refresh knowledge.

Recap

You refreshed config at runtime:

  • Expose and POST /actuator/refresh
  • @RefreshScope re-creates @Value beans; @ConfigurationProperties rebind automatically
  • Refresh is per-instance; Spring Cloud Bus broadcasts to all
  • Some boot-time settings still need a restart

Sıkça Sorulan Sorular

“Çalışma Zamanında Yapılandırmayı Yenileme” dersi ücretsiz mi?

Evet — “Çalışma Zamanında Yapılandırmayı Yenileme” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Spring Boot 4 Microservices & REST APIs kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Spring Boot 4 Microservices & REST APIs kursu toplamda 4 dersten oluşur.

“Çalışma Zamanında Yapılandırmayı Yenileme” dersinde ne öğreneceğim?

Hizmetleri yeniden başlatmadan yapılandırmayı güncelleyin. Spring Boot 4 Microservices & REST APIs ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Spring Boot 4 Microservices & REST APIs öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Spring Boot 4 Microservices & REST APIs, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“Çalışma Zamanında Yapılandırmayı Yenileme” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Spring Boot 4 Microservices & REST APIs dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Spring Boot 4 Microservices & REST APIs dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Yapılandırma Sunucusu
  2. Git Destekli Yapılandırma
  3. Yapılandırma İstemcileri
  4. Çalışma Zamanında Yapılandırmayı Yenileme
← Spring Boot 4 Microservices & REST APIs Sayfasına Dön