hazelcast spring configuration for executor-service

38 views
Skip to first unread message

atul.km...@gmail.com

unread,
Apr 28, 2017, 4:20:12 AM4/28/17
to Hazelcast
Hi, 

Please can someone help me with getting correct way to define executor-service using hazelcast spring config way. hz:executorService or hz:executor-service.
I need to define poolsize as well. 

I tried with executorConfigs map and defined a key and executorconfig with poolsize.. but no way to use that config for defining a pool.

<hz:executorService id="wfDaoAsyncPool" name="${hazelcast.group.name}_wfDaoAsyncPool" instance-ref="hazelCastServerInstance"/>
it works but no way to define poolsize in this.


Regards,
Atul

dsukho...@gmail.com

unread,
Apr 28, 2017, 8:28:52 AM4/28/17
to Hazelcast
Hi Atul,

have a look at my config, works good:


<hz:hazelcast id="hzInstance">
<hz:config>

<hz:executor-service name="my-exec--pool" pool-size="${my.pool.size}" />

</hz:config>
</hz:hazelcast>

<hz:executorService id="my-exec-pool" name="my-exec-pool" instance-ref="hzInstance"/>

</beans>

HTH, Denis

atul.km...@gmail.com

unread,
Apr 28, 2017, 10:08:53 AM4/28/17
to Hazelcast
Thanks Denis,

It worked. I defined in some different way. Logically same.

Inside hazelcastServerInstance Bean 
<property name="executorConfigs">
<map>
<entry>
<key>
<value>${hazelcast.group.name}_wfDaoAsyncPool</value>
</key>
<bean id="wfDaoAsyncPoolConfig" class="com.hazelcast.config.ExecutorConfig">
<property name="poolSize" value="${async.pool.size}"></property>
<property name="name" value="${hazelcast.group.name}_wfDaoAsyncPool"></property>
</bean>
</entry>
</map>
</property>

<hz:executorService id="wfDaoAsyncPool" name="${hazelcast.group.name}_wfDaoAsyncPool" instance-ref="hazelCastServerInstance"/> 


Reply all
Reply to author
Forward
0 new messages