Hello!
I have data-node and service-node with injected bean and doing
ContinuousQuery.
I am getting the BinaryObjectException:
Failed to deserialize object [typeName=ru.mts.service.CaseListenerService]
class org.apache.ignite.binary.BinaryObjectException: Failed to read field
[name=query]
Chanching query field to transient leads to:
(err) Failed to notify listener:
o.a.i.i.util.future.GridFutureChainListener@3a625d1borg.springframework.beans.factory.NoSuchBeanDefinitionException:
No bean named 'customBean' available
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition
customBean placed only at service.xml config.
// node filtering:
<property name="userAttributes">
<map key-type="java.lang.String" value-type="java.lang.Boolean">
<entry key="listener.service.node" value="true"/>
</map>
</property>
...
<property name="nodeFilter">
<bean class="ru.mts.config.ListenerNodeFilter"/>
</property>
...
public class QueryService implements Service {
private static final String CACHE_NAME = "cases";
@IgniteInstanceResource
private static Ignite ignite;
@LoggerResource
private static IgniteLogger log;
@SpringResource(resourceName = "customBean")
private transient Properties queryProperties;
private transient ContinuousQuery<CaseKey, Case> query;
private IgniteCache<CaseKey, Case> cache;
@Override
public void init(ServiceContext serviceContext) throws Exception {
try {
cache = ignite.cache(CACHE_NAME);
query = new ContinuousQuery<>();
query.setInitialQuery(new ScanQuery<>((k, v) ->
v.getCaseStatus().equals(CaseStatus.CLOSED)));
query.setRemoteFilterFactory(new
Factory<CacheEntryEventFilter<CaseKey, Case>>() {
@Override
public CacheEntryEventFilter<CaseKey, Case> create() {
return new CacheEntryEventFilter<CaseKey, Case>() {
@Override
public boolean evaluate(CacheEntryEvent<? extends
CaseKey, ? extends Case> e) {
return
e.getValue().getCaseStatus().equals(CaseStatus.CLOSED);
}
};
}
});
query.setLocalListener(events -> {
for (CacheEntryEvent event : events) {
// some logic using my bean
}
});
} catch (Exception e) {
log.error("Listener service error : {}", e);
}
}
@Override
public void execute(ServiceContext serviceContext) {
cache.query(query);
}
}
--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/