Announcement Announcement Module
Collapse
No announcement yet.
weird behavior, Disappeared mesages Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • weird behavior, Disappeared mesages

    I am experiencing , not sure what is wrong with this. testing with 4 messages, hard-coded within xmlTransformerBean, i can see in logs all 4 messages passing thorough filterBean (nothing rejected), but only two being received in contentTransformerBean. And interesting thing is first and third messages are the one that are received in contentTransformerBean, please let me know what might be causing this, thanks for your help.

    Code:
    <chain input-channel="responseChannel" output-channel="filteredChannel">
    		<transformer ref="xmlTransformerBean" method="transform"/>
    		<splitter ref="splitterBean"/>
    		<filter ref="filterBean" method="filter"  discard-channel="rejectedMessagesChannel" />
    	</chain>	
    	
    	<chain input-channel="filteredChannel">
    		<header-enricher>
    			<header name="valid" value="true" />
    		</header-enricher>
    		<transformer ref="contentTransformerBean" method="transform"/>
    		<router ref="productRouterBean" method="route" />
     	</chain>

  • #2
    I am betting you somehow have another consumer on filteredChannel; the default dispatcher in a DirectChannel will round robin messages to his subscribers - hence 1 and 3 will go to this chain.

    Comment


    • #3
      yes, this is it. Thanks!

      Comment


      • #4
        Unfortunately i face this again today albeit in different context. if you could point me to the reson why this is happening will be appreciated.

        In config below, i can see MessageSplitter generated 43 messages (logs) but only 11 (and every time only 11) are running through the filter and rest of the processing chain. cant find anything why this is happening.

        Code:
        <beans:bean id="unmarshallingTransformer" class="org.springframework.integration.xml.transformer.UnmarshallingTransformer">
            	<beans:constructor-arg>
                	<beans:bean class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
                    	<beans:property name="contextPath" value="a.b.c" />           
                	</beans:bean>
            	</beans:constructor-arg>
        	</beans:bean>
        		
        	<int:inbound-channel-adapter 
        		id="pollingTrigger"
        		expression="'foo'"
        		channel="requestChannel">
        		<poller fixed-rate="30000"></poller>	
        	</int:inbound-channel-adapter>
        
        	<int-http:outbound-gateway request-channel="requestChannel" 
        					           url="https://abc.com/load/getNextbatch?size=50"					           
        					           http-method="GET"
        					           expected-response-type="java.lang.String"
        					           reply-channel="responseChannel">
        	</int-http:outbound-gateway>
        	
        	<chain input-channel="responseChannel" output-channel="filteredChannel">
        	<transformer ref="unmarshallingTransformer"/>
        		<splitter ref="splitterBean"/>
        		<filter ref="filterBean" method="filter"  discard-channel="rejectedMessagesChannel" />
        	</chain>	
        	
        	<stream:stdout-channel-adapter id="rejectedMessagesChannel" charset="UTF-8" append-newline="true"/> 
        	
        	<chain input-channel="filteredChannel">	
        		<transformer ref="transformerBean" method="transform"/>
        		<router ref="routerBean" method="route" />
         	</chain>

        Thank You

        Comment


        • #5
          Turn on DEBUG logging for org.springframework.integration;

          You should see messages like this

          ...filter.MessageFilter] org.springframework.integration.filter.MessageFilt er@158105e8 received message: ...
          for messages rejected by the filter; you would then see

          ...preSend on channel 'rejectedMessagesChannel', message:...
          ...
          ...filter.MessageFilter] handler 'org.springframework.integration.filter.MessageFil ter@111edceb' produced no reply...
          and for messages that pass the filter

          ...filter.MessageFilter] handler 'org.springframework.integration.filter.MessageFil ter@53dafbaf' sending reply Message...
          ...preSend on channel 'filteredChannel', message:...
          Notice there is no "sending reply..." for rejected messages and the "produced no reply" message can be quite far away (depending on the complexity of the flow on rejectedMessagesChannel.

          Comment


          • #6
            Thanks Gary, turns out to be another silly mistake again
            My router target queue was defined of size 10 and i was not consuming it (yet), so it was blocking on that. I just added a stdout on that queue and this seems working fine now.

            Comment

            Working...
            X