1
votes

I had working asynchronous split-aggregator spring-integration (4.1.4.RELEASE) flow activated by HTTP input activator. The aggregator was backed up by org.springframework.integration.mongodb.store.MongoDbMessageStore.

New requirement came in to provide an alternative synchronous flow for it as well. This was achieved by throwing in HTTP input gateway and 2 routers for short-circuiting task executor and sending the output to the correct channel in case of sync call.

The tests was broken right away with the following stack trace. Debugging the issue revealed that persistence of the following was the root cause: 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 ...

I worked this around by removing persistency at this moment, however need it for failover purposes. What are my options?

Thanks a bunch

    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)
1
How about to try the same with ConfigurableMongoDbMessageStore? Meanwhile, I'd like to ask you about the simple configure to reproduce as a test-case. We might have a bug there: in Spring Integration or Spring Data.Artem Bilan
Thank you Artem! Will have to work on the test case. Can't hand you my test case as is without the NDA. Another issue on DirectChannel(AbstractMessageChannel).send(Message<?>, long) line: 286: org.springframework.messaging.core.DestinationResolutionException: no output-channel or replyChannel header available ` at line 226 in AbstractMessageProducingHandler)) BridgeHandler(AbstractMessageProducingHandler).sendOutput(...) line: 226 BridgeHandler(AbstractMessageProducingHandler).produceOutput(...) line: 154 BridgeHandler(AbstractMessageProducingHandler).sendOutputs(...) line: 102Irena Shai

1 Answers

0
votes

You have to share your config anyway.

Although I think <header-channels-to-string> on the <header-enricher> before an <aggregator> may help you. Because by default we serialize the Message<?> with the ConfigurableMongoDbMessageStore. And TemporaryReplyChannel header isn't Serializable.

See Header Channel Registry for more information.