Spring Integration
  1. Spring Integration
  2. INT-2009

POJO-based implementation of the ReleaseStrategy must honor the method signature of the ReleaseStrategy interface.

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Complete
    • Affects Version/s: 2.0.3, 2.0.5
    • Fix Version/s: 2.0.6, 2.1 M1
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Mac OS X 10.6.8, Java 1.6.0_26

      Description

      Signature such as "public boolean canRelease(MessageGroup group)" is not supported. The only supported one is "public boolean canRelease(Collection<payload_type> messages)"

      Attempting to use a release strategy with the former signature will yield an IllegalStateException as in the following:

      Caused by: java.lang.IllegalStateException: Invalid method parameter for payload: was expecting collection.
      	at org.springframework.util.Assert.state(Assert.java:384)
      	at org.springframework.integration.util.MessagingMethodInvokerHelper$ParametersWrapper.getPayload(MessagingMethodInvokerHelper.java:645)
      

        Activity

        Hide
        Oleg Zhurakousky added a comment -
        Show
        Oleg Zhurakousky added a comment - Fixed, pending review https://github.com/SpringSource/spring-integration/pull/36
        Hide
        Mark Fisher added a comment -

        This should be reconsidered as a documentation issue. We need to clarify that if it's necessary to interact with a MessageGroup instance (when the true POJO approach of using Collection<payload_type> is not sufficient for any reason), then the right approach is to implement the ReleaseStrategy interface. Perhaps if possible, we can include that not only in documentation but also in a warning message if the above is attempted.

        Show
        Mark Fisher added a comment - This should be reconsidered as a documentation issue. We need to clarify that if it's necessary to interact with a MessageGroup instance (when the true POJO approach of using Collection<payload_type> is not sufficient for any reason), then the right approach is to implement the ReleaseStrategy interface. Perhaps if possible, we can include that not only in documentation but also in a warning message if the above is attempted.
        Hide
        Mark Fisher added a comment -

        changing to "Task" since we need to update the documentation to clarify this situation

        Show
        Mark Fisher added a comment - changing to "Task" since we need to update the documentation to clarify this situation

          People

          • Assignee:
            Oleg Zhurakousky
            Reporter:
            Kyle Smith
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: