0

Im new to Spring Integration, I have to get a list of online agents from 3rd party web services, i tried to configure spring integration to get it, but for the channel part, i not really sure how to configure it.

My original configuration was the following, i copied from a sample that use to send request to 3rd party web services:

public interface WebServiceGateway {

    @Gateway(requestChannel = "getStatusChannel")
    public String getStatus(String var);     <------ being forced to send something
}

In my integration configuration,

@Configuration
public class IntegrationConfiguration {

   @Bean
    public MessageChannel getStatusChannel() {
        return MessageChannels.direct().get();
    }
}

The problem is, im not sending any parameter to the webservices, in requestChannel it force me to do so, so i modified the gateway part:

public interface WebServiceGateway {

    @Gateway(replyChannel = "getStatusChannel")
    public String getStatus();
}

This part remains unchanged:

@Configuration
public class IntegrationConfiguration {

   @Bean
    public MessageChannel getStatusChannel() {
        return MessageChannels.direct().get();
    }
}

It prompted me java.lang.IllegalStateException: receive is not supported, because no pollable reply channel has been configured, why can't i use MessageChannel as the reply channel? How should i configure the IntegrationConfiguration?

hades
  • 4,294
  • 9
  • 46
  • 71

1 Answers1

0

Please go through this https://spring.io/blog/2014/11/25/spring-integration-java-dsl-line-by-line-tutorial

All you need is to define an IntegrationFlow like below:

IntegrationFlows.from(requestchannel())
                .handle("requestHandler","handleInput")
                .channel(replyChannel())            
                .get();
Barath
  • 5,093
  • 1
  • 17
  • 42