ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vkulichenko <valentin.kuliche...@gmail.com>
Subject Re: Context serialization in callables
Date Thu, 10 Sep 2015 18:17:50 GMT
Hi Vadim,

Please subscribe to the Ignite users mailing list before posting messages
here. Otherwise they are not forwarded properly. See the instruction here:

vsuslov wrote
> Hi, I have a spring project where I need to form an IgniteCallable from my
> business logic and send to a particular data-node to execute. But in this
> callable I send a heavy context(lots of @Autowired dao-objects and
> services that are needed to get/set values from/to the cache while
> executing the callable, and that are serialized)
> Is there a better way?

Are these DAOs available on all nodes? If yes and you start your nodes with
a Spring XML file that contains all required beans, you can inject the
application context into the job and use it to get any required beans. The
context will be injected on the remote node where the callable is executed,
so it can be transient and will never be sent over the network. Here is an

public class MyCallable implements IgniteCallable {
    private transient ApplicationContext appCtx;

    @Override public Object call() throws Exception {
        MyDao dao = appCtx.getBean("myDao");



View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Context-serialization-in-callables-tp1335p1341.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

View raw message