Changed default ExecutionContext serialization mechanism

The current default for serializing the ExecutionContext is via XStream
using Jettison's driver.  However, recent updates to Jettison make it
incompatible with XStream with no progress on a fix.  Because of this,
and to encourage the use of well supported library combinations, the
default ExecutionContext serialization mechanism for Spring Batch has
been switched to Jackson (via the
Jackson2ExecutionContextStringSerializer).  This commit also depricates
the XStreamExecutionContextStringSerializer for removal at a later date.
However, it is still available for users that require that during a
migration.

Resolves BATCH-2575
This commit is contained in:
Michael Minella
2017-03-22 15:25:14 -05:00
parent 7f94ca2e84
commit 4ad00166f8
5 changed files with 31 additions and 19 deletions

View File

@@ -29,7 +29,7 @@ import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.repository.ExecutionContextSerializer;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.dao.DefaultExecutionContextSerializer;
import org.springframework.batch.core.repository.dao.XStreamExecutionContextStringSerializer;
import org.springframework.batch.core.repository.dao.Jackson2ExecutionContextStringSerializer;
import org.springframework.batch.item.database.support.DataFieldMaxValueIncrementerFactory;
import org.springframework.core.serializer.Serializer;
import org.springframework.dao.DataAccessException;
@@ -153,7 +153,7 @@ public class JobRepositoryFactoryBeanTests {
factory.afterPropertiesSet();
Serializer<Map<String, Object>> serializer = (Serializer<Map<String,Object>>) ReflectionTestUtils.getField(factory, "serializer");
assertTrue(serializer instanceof XStreamExecutionContextStringSerializer);
assertTrue(serializer instanceof Jackson2ExecutionContextStringSerializer);
}
@Test