Class SpringCloudAutoConfiguration.NonWebApplicationGuard

java.lang.Object
io.axoniq.framework.springboot.autoconfig.SpringCloudAutoConfiguration.NonWebApplicationGuard
Enclosing class:
SpringCloudAutoConfiguration

@Configuration(proxyBeanMethods=false) @ConditionalOnProperty(name="axon.springcloud.enabled", havingValue="true", matchIfMissing=true) @ConditionalOnNotWebApplication public static class SpringCloudAutoConfiguration.NonWebApplicationGuard extends Object
Rejects an application that distributes messages over Spring Cloud without being able to receive any.

Members reach each other over HTTP, so a member is only reachable if it serves the connector's endpoints. With no servlet web application there is nothing to map them onto, while this member still registers with discovery and publishes its capabilities — leaving the other members routing their share of the messages to an address that cannot answer. Failing at start-up says so, rather than leaving those messages to time out for as long as this member is a member.

Two conditions are needed to cover that, because "not a servlet web application" is both the application with no web stack at all, guarded here, and the one built on WebFlux, guarded by SpringCloudAutoConfiguration.ReactiveWebApplicationGuard.

Since:
5.4.0
Author:
Allard Buijze
  • Constructor Details

    • NonWebApplicationGuard

      public NonWebApplicationGuard()
      Constructs a NonWebApplicationGuard, which is only ever reached when the connector is enabled in an application that cannot serve its endpoints.
      Throws:
      IllegalStateException - always, as reaching this constructor is the misconfiguration it reports