External request on application startup

Hi,

each time I start my Vaadin app in my IDE, I get a message from our proxy that a call to async-io.org/version.html has been blocked (this is a pretty restrictive corporate environment).
Is it possible to disable/suppress this call from my app?

Thanks!

It seems to be an Atmosphere version check call.
You should be able to disable the version check with the property org.atmosphere.runtime.AtmosphereFramework.analytics=false
See configuration for more details

Unfortunately, this didn’t do the trick.

Does setting the property in one of the ways mentioned here:

work?

Nope. I tried all 3 of them, and also to set it as JVM parameter.

Actually, Vaadin seems to prevent that call by default in PushRequestHandler.initAtmosphere()

Can you double-check that there are no additional Atmosphere initializations other than the one done by Vaadin?

This even happens with a most simple starter app consisting of nothing but the GreetService, or the task list example.

Ah! It looks like it is Hilla that registers an additional AtmosphereServlet, but it does not disable analytics.

If your application is pure Flow, you can exclude com.vaadin:hilla from com.vaadin:vaadin-spring-boot-starter.

Thanks a lot, this fixed it.

For the record, if you don’t want to exclude Hilla, you can add this bean to your application

    @Bean
    BeanPostProcessor disableAtmoshpereAnalytics() {
        return new BeanPostProcessor() {

            @Override
            public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
                if (bean instanceof ServletRegistrationBean<?> reg && beanName.equals("atmosphereServlet")) {
                    reg.getInitParameters().put(ApplicationConfig.ANALYTICS, "false");
                }
                return bean;
            }
        };
    }

For the record, this problem will be tracked by Disable analytics for initialized Atmosphere · Issue #4240 · vaadin/hilla · GitHub

1 Like

Adding also Simplify Atmosphere configuration customization · Issue #22568 · vaadin/flow · GitHub for the Flow Atmosphere instance configuration

1 Like

Just tried the approach and it works great. Running the external request in a background thread during startup keeps the UI responsive, and using UI.access() for updates was the missing piece for me.