Announcement Announcement Module
Collapse
No announcement yet.
SI Aggregator - Timeout release strategy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I don't get what you mean, haven't you defined the correlation strategy bean in the xml file too?

    Comment


    • #17
      Originally posted by Amol Nayak View Post
      I don't get what you mean, haven't you defined the correlation strategy bean in the xml file too?
      I have already made a seprate java bean for correlation strategy and passes it reference in the xml configuration file itself, Now I want it completeley in xml configuration file itself ..no java bean I want to keep ..!!

      Comment


      • #18
        Hi Saral,

        You can configure it via the correlation-strategy-expression attribute (correlation logic via a SpEL expression) instead of correlation-strategy attribute. Something like (example taken from reference manual)

        Code:
        correlation-strategy-expression="payload.person.id"
        Similarly for ReleaseStrategy
        Code:
        release-strategy-expression="payload.size() gt 5"
        Here you don't have to write beans, you can use SpEL to define your correlation and release strategy

        Other thing that I observe is that with MessageGroupStoreReaper we can use MethodInvokingReleaseStrategy instead of TimeoutCountSequenceSizeReleaseStrategy. Write a bean and method that always return false. (I want all the messages to be released / expired at fixed interval)

        Code:
                <bean id="myReleaseStrategy" class="com.test.MyReleaseStrategy" />
        	
        	<bean id="releaseStrategy"
        		class="org.springframework.integration.aggregator.MethodInvokingReleaseStrategy">
        		<constructor-arg name="object" ref="myReleaseStrategy" />
        		<constructor-arg name="methodName" value="canRelease" />
        	</bean>
        Code:
        public class MyReleaseStrategy {
        	public boolean canRelease() {
        		System.out.println("MyReleaseStrategy.canRelease called .....");
        		return false;
        	}
        }
        Regards,
        Pranav
        Last edited by Pranav Kumar Varshney; Nov 29th, 2011, 01:08 AM.

        Comment


        • #19
          Hi Pranav ,
          Thanks for the explnation it is working now,I done the corelational-startergy expression attribute via SPEL itself and it's working..!!Thanks a lot..!!
          Last edited by SARAL SAXENA; Nov 29th, 2011, 01:57 AM.

          Comment

          Working...
          X