zutnop / telekom-workflow-engine

An embeddable Java framework for running long-lived business processes
MIT License
27 stars 14 forks source link

Hazelcast 3.2+ compatibility #3

Closed SiimSu closed 9 years ago

SiimSu commented 9 years ago

From Hazelcast version 3.2 and up com.hazelcast.nio.serialization.DataSerializable does not extend java.io.Serializable anymore. For that reason serialization errors start to occur:

08:48:47.403 --- ERROR WorkProducerJobImpl.run(WorkProducerJobImpl.java:91) - java.io.NotSerializableException: ee.telekom.workflow.core.workunit.WorkUnit org.apache.commons.lang3.SerializationException: java.io.NotSerializableException: ee.telekom.workflow.core.workunit.WorkUnit at org.apache.commons.lang3.SerializationUtils.serialize(SerializationUtils.java:157) ~[commons-lang3-3.3.2.jar:3.3.2]

zutnop commented 9 years ago

Hmm, the fact that WorkProducerServiceImpl uses commons deep cloning method to clone the simple WorkUnit instance before adding it to Hazelcast queue looks like an overkill to me right now.

But I won't touch that area because it seems that it's much easier just to add the Serializable interface to the WorkUnit class declaration. This should fix the issue and keep everything backwards compatible also.