Le printemps de l'intégration de la passerelle de “Dispatcher a pas d'abonnés”

Je suis une exception Dispatcher has no subscribers sur le outboundChannel et ne peut pas comprendre pourquoi. Je suis sûr que c'est quelque chose de simple, j'ai dépouillé mon code à un très simple exemple ci-dessous:

Mon contexte:

<bean id="requestService"
    class="com.sandpit.RequestService" />

<integration:channel id="inboundChannel" />

<integration:service-activator id="service"
    input-channel="inboundChannel"
    output-channel="outboundChannel"
    ref="requestService"
    method="handleRequest" />

<integration:channel id="outboundChannel" />

<integration:gateway id="gateway"
    service-interface="com.sandpit.Gateway"
    default-request-channel="inboundChannel"
    default-reply-channel="outboundChannel" />

<bean class="com.sandpit.GatewayTester">
    <property name="gateway"
        ref="gateway" />
</bean>

Mon code Java est:

public interface Gateway {

    String receive();
    void send(String message);
}

public class RequestService {

    public String handleRequest(String request) {

        return "Request received: " + request;
    }
}

public class GatewayTester implements ApplicationListener<ContextRefreshedEvent> {

    private Gateway gateway;

    public void setGateway(Gateway gateway) {

        this.gateway = gateway;
    }

    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {

        gateway.send("Hello world!");
        System.out.println("FROM SERVICE: " + gateway.receive());
    }
}

Remarque: Un point d'arrêt ne me dire que la RequestService est en fait le traitement de la demande.

OriginalL'auteur Cheetah | 2014-05-16