0

We have a app config and spring boot app. we have more than 2 instances of app deployed in app service. Instead of doing polling I want to get the updates as push notification, For which azure app config provide event grid notification, One of the handler for such notification is web hook , for which i am looking to write a post rest service which event grid can use as a endpoint. But I want to understand whether all my instances endpoint will get called with described approach?

pvjhs
  • 549
  • 1
  • 9
  • 24

1 Answers1

2

The spring-cloud-azure-appconfiguration-config-web package currently doesn't have a push based model integrated with it, but it is under development. There is a single instance push refresh in the current SNAPSHOT version, https://github.com/microsoft/spring-cloud-azure/tree/master/spring-cloud-azure-appconfiguration-config-web/src/main/java/com/microsoft/azure/spring/cloud/config/web/pushrefresh.

In order to refresh multiple instances Spring Cloud Bus needs to be set up to communication between the instances to propagate the refresh message.

We have done some work on multi instance refresh if you are interested to see what we are doing you can look here, though it is incomplete: https://github.com/mrm9084/spring-cloud-azure/tree/37e968fc8ea4868d0e4d67afc9e47105c5bb01b2/spring-cloud-azure-appconfiguration-config-web/src/main/java/com/microsoft/azure/spring/cloud/config/web/pushbusrefresh

mrm9084
  • 430
  • 1
  • 3
  • 12
  • So the webhook handler(if we provide a custom controller of our own) as a endpoint to event grid subscription in app config , only 1 instance will get notified , now its app responsibility to communicate it to other instances , which this future release of library will fulfill automatically without app has to take care of it ? Is this correct? – pvjhs Jul 31 '20 at 16:29
  • 1
    Web Hooks will only notify one instance. Apps should use Spring Bus, take a look at `/actuator/bus-refresh`, to refresh the whole application. Both solutions will require the app to still need configurations for some service to use with Spring Bus, i.e. Azure Service Bus, RabbitMQ. The library will just take care of validation and integration with the rest of the library. You could think of it as just a new Spring Actuator endpoint. – mrm9084 Jul 31 '20 at 17:29