ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vdpyatkov <vldpyat...@gmail.com>
Subject Re: Deploying service programmatically hangs the app
Date Fri, 05 Aug 2016 15:35:38 GMT
Hello,

Please properly subscribe to the mailing list so that the community can
receive email notifications for you messages. Here is the instruction:
http://apache-ignite-users.70518.x6.nabble.com/mailing_list/MailingListOptions.jtp?forum=1

Could you please provide full example, where hang taking place?
You will be careful when reusing IgniteConfiguration, CommunicationSPI and
discoverySPI. The beans can not reuse, because instances of it store state
in private fields.



juanma.cvega wrote
> Hi,
> 
> I'm trying to create a cluster service but the application hangs. 
> I've tried to deploy a simple service that does nothing following the
> example from the documentation. When I do that, the application just
> hangs. I've tried using xml configuration and setting the service before
> calling Ignition.start(). At that point it works but I need to create the
> service post context initialization so the service gets injected some
> application services. 
> This is what I'm trying to do:
> 
> public class IgniteClusterSingletonStarter {
> @PostConstruct
>    public void init() {
>       log.info("APP_INIT: initializing Ignite Cluster service '{}'",
> RELOAD_SERVICE_NAME);
>       ignite.services().deploy(serviceConfiguration());
>    }
> 
>    private ServiceConfiguration serviceConfiguration() {
>       ServiceConfiguration configuration = new ServiceConfiguration();
>       configuration.setMaxPerNodeCount(1);
>       configuration.setName("test");
>       configuration.setService(testService); //This implementation just
> adds a log on each method
>       configuration.setTotalCount(1);
>       return configuration;
>    }
> }
> 
> And this is my xml configuration:
> 
>    
> <bean id="igniteClusterSingletonStarter"
>          class="com.reload.IgniteClusterSingletonStarter">
>       
> <constructor-arg name="ignite" ref="ignite"/>
>       
> <constructor-arg name="reloadService" ref="reloadService"/>
>    
> </bean>
> 
> <bean id="queue" factory-method="queue" factory-bean="ignite">
>       
> <constructor-arg name="name" value="${ignite.queue.reload}"/>
>       
> <constructor-arg name="cap" value="0"/>
>       
> <constructor-arg name="cfg" ref="collectionConfiguration"/>
>    
> </bean>
>    
> <bean id="collectionConfiguration"
> class="org.apache.ignite.configuration.CollectionConfiguration">
>       
> <property name="collocated" value="false"/>
>       
> <property name="backups" value="1"/>
>    
> </bean>
>    
> <bean id="igniteEvents" factory-bean="ignite" factory-method="events"/>
>    

>    
> <bean id="ignite" class="org.apache.ignite.Ignition"
> factory-method="start">
>       
> <constructor-arg ref="igniteConfiguration"/>
>    
> </bean>
>    
> <bean id="ignition" class="org.apache.ignite.Ignition"/>
>    

>    
> <bean id="igniteConfiguration"
> class="org.apache.ignite.configuration.IgniteConfiguration">
>       
> <property name="discoverySpi" ref="discoverySpi"/>
>       
> <property name="communicationSpi" ref="communicationSpi"/>
>       

>       

>       
> <property name="includeEventTypes">
>          
> <list>
>             
> <util:constant
> static-field="org.apache.ignite.events.EventType.EVT_NODE_FAILED"/>
>             
> <util:constant
> static-field="org.apache.ignite.events.EventType.EVT_NODE_JOINED"/>
>             
> <util:constant
> static-field="org.apache.ignite.events.EventType.EVT_NODE_LEFT"/>
>          
> </list>
>       
> </property>
>       
> <property name="gridName" value="${ignite.grid.name}"/>
>    
> </bean>
>    
> <bean id="igniteSingletonServiceConfiguration"
> class="org.apache.ignite.services.ServiceConfiguration">
>       
> <property name="name" value="priceChangeAlertReloadService"/>
>       
> <property name="service" ref="test"/>
>       
> <property name="maxPerNodeCount" value="1"/>
>       
> <property name="totalCount" value="1"/>
>    
> </bean>
>    
> <bean id="test"
> class="com.iggroup.wt.pricechangealerts.reload.TestService"/>
> </beans>
> 
> Thanks.





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Deploying-service-programmatically-hangs-the-app-tp6791p6805.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Mime
View raw message