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

Messaging Gateway: the @Gateway(payloadExpression = ) is not consulted when no method args

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.3.15
    • Fix Version/s: 5.1 M1, 5.0.5, 4.3.16
    • Component/s: Core
    • Labels:

      Description

      @Gateway(payloadExpression = "'foo'")
      String getData();
      

      We end up with the exception like:

      java.lang.IllegalStateException: receive is not supported, because no pollable reply channel has been configured
      
      	at org.springframework.util.Assert.state(Assert.java:73)
      	at org.springframework.integration.gateway.MessagingGatewaySupport.receive(MessagingGatewaySupport.java:447)
      	at org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:510)
      	at org.springframework.integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:469)
      	at org.springframework.integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:460)
      

      Just because the payloadExpression is populated to the GatewayMethodInboundMessageMapper, but not into the GatewayMethodMetadata to be available when we consult for non-args method:

      if (!hasPayloadExpression && this.methodMetadataMap != null) {
      	// check for the method metadata next
      	GatewayMethodMetadata metadata = this.methodMetadataMap.get(method.getName());
      	hasPayloadExpression = (metadata != null) && StringUtils.hasText(metadata.getPayloadExpression());
      }
      

        Attachments

          Activity

            People

            • Assignee:
              abilan Artem Bilan
              Reporter:
              abilan Artem Bilan
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: