Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-2636

GatewayProxyFactoryBean Annotation overwrite properties

    XMLWordPrintable

    Details

      Description

      In the GatewayProxyFactoryBean the reply timeout is overwritten by the annotation value, if an gateway annotation is given. IMHO this is an error because no where it is explained that there is a default value in the gateway annotation, where this value is set to -1 (unbound). So in case the property is set and the annotation is used as explained in the documentation, it overwrittes the reply timeout, without any notice to the developer.

      The interesting lines are (#336 and following)

      Gateway gatewayAnnotation = method.getAnnotation(Gateway.class);

      long replyTimeout = this.defaultReplyTimeout;

      if (gatewayAnnotation != null) {

      replyTimeout = gatewayAnnotation.replyTimeout();

      This should either be fixed by adding a note in the documentation or by changing the code

      if (gatewayAnnotation.replyTimeout() > replyTimeout)

      { relyTimeout = gatewayAnnotation.replyTimeout(); }

      It took me several hours to find out why the reply timeout stayed to unbound, even if the property was set correctly. In the documentation there is no hint that the annotation has a default value of -1. IMHO the property should overwrite the annotation.

        Attachments

          Activity

            People

            Assignee:
            grussell Gary Russell
            Reporter:
            mbeil Matthias Beil
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0d
                0d
                Logged:
                Time Spent - 3h
                3h