Announcement Announcement Module
Collapse
No announcement yet.
Problem in Setting up http Inbound and outbound gateways... Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem in Setting up http Inbound and outbound gateways...

    Hi,

    I am new to Spring integration and am trying to setup http Inbound and outbound sevice. The evironment is something like this ..
    I have two different server A(Application server) and B(Backoffice server). Server A will be responsible to send an
    Http message to the server B with help of Http gateways.

    I have created an http inbound gateway on server B like this :

    <channel id="httpRequestChannel"/>
    <channel id="httpReplyChannel"/>

    <bean id="httpInbouddateway" class="org.springframework.integration.http.HttpIn boundEndpoint">
    <property name="requestChannel" ref="httpRequestChannel" />
    <property name="replyChannel" ref="httpReplyChannel" />
    <property name="expectReply" value="true" />
    </bean>

    <service-activator input-channel="httpRequestChannel" ref="httpProcessingactivator" method="doProcessRequest"
    output-channel="httpReplyChannel"/>
    <bean id="httpProcessingactivator" class="mypoc.http.serviceActivator.HttpProcessinga ctivator"/>

    Till here my inbound gateway is working fine. I have fired the url like http://localhost:9704/httpintest/parameter1 and the service invoker is invokedand the request get processed.

    Now,on the server A , i have configured an http outbound gateway like this :

    <bean id="httpOutboundgateway" class="org.springframework.integration.http.HttpOu tboundEndpoint" >
    <constructor-arg value="http://localhost:9704/httpintest" />
    <property name="outputChannel" ref="httpRequestChannel" />
    <property name="sendTimeout" value="7000" />
    </bean>

    and with the help of following code , i am tring to send a message in the channel
    Message<Map> msg= httpObjectCreation.createObject(objectmap);//in object map i am passing parameters
    ChannelResolver channelResolver = new BeanFactoryChannelResolver(context);
    DirectChannel inputChannel = (DirectChannel) channelResolver.resolveChannelName("httpRequestCha nnel");
    inputChannel.send(msg);

    But it fail with exception
    org.springframework.integration.message.MessageDel iveryException: Dispatcher has no subscribers.

    How can i use Http inbound and outbound gateways if they are on different servers ie. the Server A should send a message in
    the httpRequestChannel and the message should be picked up by the Server B for processing.
    Any suggestion please. Can it be done by some other way but using gateway concepts?
    Thanks
    Mack

  • #2
    i see in your outbound no in-channel like :

    Code:
    <http:outbound-gateway 
    		request-channel="http-requests"
    		extract-request-payload="true"
    		charset="UTF-8"
    		request-executor="http-executor"
    		reply-channel="http-replies"/>

    Comment

    Working...
    X