With this marshalling in the listener, I'd never insert from more than
one thread.
If multiple threads procure the events, queue them to a single thread
that does the actual insertion.
(Note that this is just my "gut feeling", not based on experience in
this particular case.)
-W
On 13/02/2014, ters <ters(a)ukr.net> wrote:
Hi Davide. I'll try to explain.
We inserting a lot of events per second into StatefulKnowledgeSession, this
process performs in single thread. There is possible situation when our
event processor engine (CEP) can crash under high load, so we trying to
save
actual last state of knowledge session as often as possible. For this
purposes we use WorkingMemoryEventListener and perform session marshaling
in
every listener methods (and not only):
public void objectInserted(ObjectInsertedEvent event) {
marshalWorkingMemory();
}
public void objectUpdated(ObjectUpdatedEvent event) {
marshalWorkingMemory();
}
public void objectRetracted(ObjectRetractedEvent event) {
marshalWorkingMemory();
}
Marshaled working memory we put into infinispan to synchronize with other
reserved CEP engines.
Because of we use fireUntillHalt mode and events inserted very fast it
appears that marshaling invokes in several threads. This approach causes
mentioned exception from time to time.
That is my case. I'll appreciate if you can suggest some another/better
approach to save actual knowledge session state in case of crashing current
engine.
--
View this message in context:
http://drools.46999.n3.nabble.com/ArrayIndexOutOfBoundsException-under-hi...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users