ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From afedotov <alexander.fedot...@gmail.com>
Subject Re: Using AbstractAnnotationConfigDispatcherServletInitializer
Date Mon, 10 Jul 2017 16:28:25 GMT
Hi,

Actually, it should have worked. Try adding a call to
ignite.afterPropertiesSet() in IgniteSpringBean definition method.

An example of a configuration that works is as follows:

@Configuration
public class IgniteConfig {

    @Bean
    public IgniteSpringBean igniteSpringBean() {
        IgniteSpringBean bean = new IgniteSpringBean();

        bean.setConfiguration(igniteConfiguration());

        return bean;
    }

    public IgniteConfiguration igniteConfiguration() {
        IgniteConfiguration cfg = new IgniteConfiguration();

        //cfg.setClientMode(true);
        cfg.setGridName("igniteInstanceName");
        cfg.setPeerClassLoadingEnabled(true);
        cfg.setMetricsLogFrequency(0);

        TcpCommunicationSpi commSpi = new TcpCommunicationSpi();

        commSpi.setIdleConnectionTimeout(400000);

        cfg.setCommunicationSpi(commSpi);

        TcpDiscoveryVmIpFinder ipFinder = new TcpDiscoveryVmIpFinder();

        ipFinder.setAddresses(Collections.singletonList("localhost:47500..47509"));

        TcpDiscoverySpi discoverySpi = new TcpDiscoverySpi();

        discoverySpi.setIpFinder(ipFinder);

        cfg.setDiscoverySpi(discoverySpi);

        return cfg;
    }
}


Kind regards,
Alex.

On Mon, Jul 10, 2017 at 6:50 PM, Humphrey [via Apache Ignite Users] <
ml+s70518n14596h10@n6.nabble.com> wrote:

> Thanks for the reply:
>
> I tried the following and was not succesfull.
>
> @Configuration
> @EnableWebMvc
> @ComponentScan(basePackages = {"mypackage"})
> public class AppConfig {
>
> 	@Bean
> 	public IgniteSpringBean igniteInstance() {
> 		IgniteSpringBean ignite = new IgniteSpringBean();
> 		ignite.setConfiguration(getIgniteConfiguration());
> 		return ignite;
> 	}
> 	
> 	private IgniteConfiguration getIgniteConfiguration() {
> 		IgniteConfiguration cfg = new IgniteConfiguration();
> 		......
>
>
> Should it be added somewhere else? Is there an example of this?
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Using-
> AbstractAnnotationConfigDispatcherServletInitializer-tp14592p14596.html
> To start a new topic under Apache Ignite Users, email
> ml+s70518n1h65@n6.nabble.com
> To unsubscribe from Apache Ignite Users, click here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1&code=YWxleGFuZGVyLmZlZG90b2ZmQGdtYWlsLmNvbXwxfC0xMzYxNTU0NTg=>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Using-AbstractAnnotationConfigDispatcherServletInitializer-tp14592p14599.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.
Mime
View raw message