Announcement Announcement Module
Collapse
No announcement yet.
MongoDB message store throwing warnings (hearders cannot be deserialized) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MongoDB message store throwing warnings (hearders cannot be deserialized)

    I'm testing some things and using a MongoDB message store behind a queue channel for persistence. Whenever a message is stored or when a service activator attempts to read the messages there's 2 exceptions thrown about the headers

    Code:
    0:19:26.454 WARN  [com.simongo.Main.main()][org.springframework.integration.mongodb.store.MongoDbMessageStore] Header 'errorChannel' could not be deserialized.
    org.springframework.data.mapping.model.MappingException: No property null found on entity class java.util.concurrent.CountDownLatch to bind constructor parameter to!
    	at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:90)
    Code:
    10:19:26.456 WARN  [com.simongo.Main.main()][org.springframework.integration.mongodb.store.MongoDbMessageStore] Header 'replyChannel' could not be deserialized.
    org.springframework.data.mapping.model.MappingException: No property null found on entity class java.util.concurrent.CountDownLatch to bind constructor parameter to!
    at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:90)
    Here is the integration part of my configuration:

    Code:
    	<int:gateway id="gateway" default-request-timeout="5000"
    		default-reply-timeout="5000" default-request-channel="requestChannel"
    		default-reply-channel="replyChannel" service-interface="com.simongo.service.StringConversionService">
    		<int:method name="convertToUpperCase" />
    	</int:gateway>
    
    	<int:gateway id="gateway2" default-request-timeout="5000"
    		default-reply-timeout="5000" default-request-channel="otherChannel"
    		default-reply-channel="replyChannel2"
    		service-interface="com.simongo.service.StringConversionOtherService">
    		<int:method name="convertToOther" />
    	</int:gateway>
    
    	<int:service-activator id="serviceActivator"
    		input-channel="requestChannel" output-channel="replyChannel"
    		expression="payload.toUpperCase()">
    		<int:poller fixed-delay="1000000"></int:poller>
    	</int:service-activator>
    
    	<int:service-activator id="serviceActivator2"
    		input-channel="otherChannel" output-channel="replyChannel2"
    		expression="payload.toLowerCase()">
    		<int:poller fixed-delay="100000"></int:poller>
    	</int:service-activator>
    
    
    	<int:channel id="replyChannel" />
    	<int:channel id="requestChannel">
    		<int:queue message-store="mongoDbMessageStore" />
    	</int:channel>
    
    
    	<int:channel id="replyChannel2" />
    	<int:channel id="otherChannel">
    		<int:queue message-store="mongoDbMessageStore" />
    	</int:channel>
    
    	<bean id="mongoDbMessageStore"
    		class="org.springframework.integration.mongodb.store.MongoDbMessageStore">
    		<constructor-arg ref="mongoDbFactory" />
    	</bean>
    This is what a message looks like in Mongo:
    Code:
    {
      "_id": { "$oid" : "50D32C7E3004E2E1223EFAA8" },
      "_createdDate": 1356016766415,
      "_class": "org.springframework.integration.mongodb.store.MongoDbMessageStore$MessageWrapper",
      "_groupId": "mongoDbMessageStore:otherChannel",
      "payload": "test",
      "headers": {
        "timestamp": 1356016766413,
        "id": {
          "_value": "cae21a36-8892-42d1-9489-a7fa431051bb",
          "_class": "java.util.UUID"
        },
        "errorChannel": {
          "receiveTimeout": 5000,
          "latch": {
            "sync": {
              "state": 1
            }
          },
          "_class": "org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel"
        },
        "replyChannel": {
          "receiveTimeout": 5000,
          "latch": {
            "sync": {
              "state": 1
            }
          },
          "_class": "org.springframework.integration.core.MessagingTemplate$TemporaryReplyChannel"
        }
      },
      "_payloadType": "java.lang.String",
      "_group_timestamp": 1356016766415,
      "_group_update_timestamp": 1356016766415,
      "_last_released_sequence": 0,
      "_group_complete": false
    }
    I'm using s-i 2.2 and tested it with s-i-mongodb 2.2 and 2.1.3

  • #2
    These are live objects (replyChannel and errorChannel); they can't be persisted.

    You cannot use persistent channels in this scenario (where a thread is waiting in the gateway for a reply). You have to use async processing (where the reply is sent to, for example, an outbound channel adapter, which correlates the reply with the request).

    Comment


    • #3
      That was the problem thanks. Was working up from an example app.

      Comment


      • #4
        Originally posted by Gary Russell View Post
        These are live objects (replyChannel and errorChannel); they can't be persisted.

        You cannot use persistent channels in this scenario (where a thread is waiting in the gateway for a reply). You have to use async processing (where the reply is sent to, for example, an outbound channel adapter, which correlates the reply with the request).
        Any chance there's an example of this type of implementation somewhere?

        Comment

        Working...
        X