我使用了HTTP输入激活器激活的异步拆分聚合器spring-integration(4.1.4.RELEASE)流程。聚合器由org.springframework.integration.mongodb.store.MongoDbMessageStore备份。
新的要求也是为它提供替代的同步流程。这是通过投入HTTP输入网关和2个路由器来实现短路任务执行器并在同步调用的情况下将输出发送到正确的信道来实现的。
使用以下堆栈跟踪立即打破测试。调试问题表明以下持久性是根本原因: class org.springframework.messaging.core.GenericMessagingTemplate $ TemporaryReplyChannel ==> class java.util.concurrent.CountDownLatch ==> class java.util.concurrent.CountDownLatch $ Sync ==> class java.util.concurrent.locks.AbstractQueuedSynchronizer $ Node ==> class java.lang.Thread ==> class java.lang.ThreadGroup ==> class java.lang.ClassLoader ...
我通过此时删除持久性来解决此问题,但需要将其用于故障转移目的。我有什么选择?
非常感谢
Caused by: java.lang.StackOverflowError
at sun.reflect.generics.parser.SignatureParser.parsePackageNameAndSimpleClassTypeSignature(SignatureParser.java:330)
at sun.reflect.generics.parser.SignatureParser.parseClassTypeSignature(SignatureParser.java:312)
at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:291)
at sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:285)
at sun.reflect.generics.parser.SignatureParser.parseTypeSignature(SignatureParser.java:487)
at sun.reflect.generics.parser.SignatureParser.parseZeroOrMoreTypeSignatures(SignatureParser.java:610)
at sun.reflect.generics.parser.SignatureParser.parseFormalParameters(SignatureParser.java:587)
at sun.reflect.generics.parser.SignatureParser.parseMethodTypeSignature(SignatureParser.java:577)
at sun.reflect.generics.parser.SignatureParser.parseMethodSig(SignatureParser.java:173)
at sun.reflect.generics.repository.ConstructorRepository.parse(ConstructorRepository.java:55)
at sun.reflect.generics.repository.ConstructorRepository.parse(ConstructorRepository.java:43)
at sun.reflect.generics.repository.AbstractRepository.<init>(AbstractRepository.java:74)
at sun.reflect.generics.repository.GenericDeclRepository.<init>(GenericDeclRepository.java:48)
at sun.reflect.generics.repository.ConstructorRepository.<init>(ConstructorRepository.java:51)
at sun.reflect.generics.repository.ConstructorRepository.make(ConstructorRepository.java:69)
at java.lang.reflect.Constructor.getGenericInfo(Constructor.java:90)
at java.lang.reflect.Constructor.getGenericParameterTypes(Constructor.java:245)
at org.springframework.data.util.TypeDiscoverer.getParameterTypes(TypeDiscoverer.java:161)
at org.springframework.data.util.ParentTypeAwareTypeInformation.getParameterTypes(ParentTypeAwareTypeInformation.java:28)
at org.springframework.data.mapping.model.PreferredConstructorDiscoverer.buildPreferredConstructor(PreferredConstructorDiscoverer.java:103)
at org.springframework.data.mapping.model.PreferredConstructorDiscoverer.<init>(PreferredConstructorDiscoverer.java:74)
at org.springframework.data.mapping.model.BasicPersistentEntity.<init>(BasicPersistentEntity.java:92)
at org.springframework.data.mongodb.core.mapping.BasicMongoPersistentEntity.<init>(BasicMongoPersistentEntity.java:74)
at org.springframework.data.mongodb.core.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:91)
at org.springframework.data.mongodb.core.mapping.MongoMappingContext.createPersistentEntity(MongoMappingContext.java:39)
at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:279)
at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.createAndRegisterProperty(AbstractMappingContext.java:469)
at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.doWith(AbstractMappingContext.java:426)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:604)
at org.springframework.data.mapping.context.AbstractMappingContext.addPersistentEntity(AbstractMappingContext.java:294)
at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.createAndRegisterProperty(AbstractMappingContext.java:469)
at org.springframework.data.mapping.context.AbstractMappingContext$PersistentPropertyCreator.doWith(AbstractMappingContext.java:426)
at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:604)
答案 0 :(得分:0)
无论如何,您必须共享您的配置。
虽然我认为<header-channels-to-string>
<header-enricher>
之前的<aggregator>
可能对您有所帮助。因为默认情况下我们使用Message<?>
序列化ConfigurableMongoDbMessageStore
。 TemporaryReplyChannel
标题不是Serializable
。
有关详细信息,请参阅Header Channel Registry。