Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: no pollable reply channel has been configured

  1. #1
    Join Date
    Sep 2010
    Posts
    16

    Default no pollable reply channel has been configured

    Hi,

    I'm trying to invoke web-service through spring integration

    public Name getNames();

    But the problem is java.lang.IllegalStateException: receive is not supported, because no pollable reply channel has been configured

    In the xml,

    <gateway id="wsgateway" service-interface="com.company.project.integration.WSGatew ay"
    default-request-channel="input_channel"
    default-reply-channel="output_channel" />

    <channel id="output_channel" />
    <channel id="input_channel" />

    <ws:outbound-gateway id="externalws"
    request-channel="input_channel" reply-channel="output_channel"
    uri="${wsurl}" marshaller="marshaller" unmarshaller="marshaller"
    message-factory="messageFactory" />

    <beans:bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMe ssageFactory">
    <beans: property name="messageFactory">
    <beans:bean class="com.sun.xml.internal.messaging.saaj.soap.ve r1_1.SOAPMessageFactory1_1Impl">
    </beans:bean>
    </beans: property>
    </beans:bean>

    <beans:bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <beans: property name="contextPaths">
    <beans:array>
    <beans:value>com.company.ws.integration.clientob j</beans:value>
    </beans:array>
    </beans: property>
    </beans:bean>


    My question if there is no input, what should be proper channel tag required?

    can someone from integration team address this, out there for quiet a long?
    - Thanks
    Last edited by techie; Mar 23rd, 2011 at 11:44 AM.

  2. #2
    Join Date
    May 2011
    Location
    Austin TX
    Posts
    25

    Default

    Has anyone come up with the solution for this?

  3. #3
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Not sure i understand the question, but you may want to start with sample which does invoke WS via SI http://git.springsource.org/spring-i...tbound-gateway

  4. #4
    Join Date
    May 2011
    Location
    Austin TX
    Posts
    25

    Default

    I have two subsystems that I am trying to integrate using spring integration. The idea is that these subsystems may or may not be in the same VM or even on the same machine. By using spring integration, I should be able to change out the communication mechanism (in memory, jms, etc.) without changing the core functionality. Part of the inter-subsystem communication requires one to ask the other for information. The request method often times a no-arg method. I've tried to simulate that behavior in the example below. Basically, it's a gateway on one end and a service-activator on the other end with a client that calls the get() method through the gateway.

    Here is my example:

    <integration:channel id="request"/>
    <integration:channel id="reply"/>

    <integration:gateway id="artifactProvider" service-interface="ArtifactProvider">
    <integration:method name="getArtifact" request-channel="request" reply-channel="reply"/>
    </integration:gateway>

    <integration:service-activator input-channel="request" output-channel="reply" ref="artifactManager" method="getArtifact"/>
    <bean id="artifactManager" class="ArtifactManager"/>


    public interface ArtifactProvider
    {
    Object getArtifact();
    }

    public class ArtifactManager implements ArtifactProvider
    {

    public Object getArtifact()
    {
    return "this is the artifact";
    }
    }

    public class TestApp
    {
    public static void main(String[] args)
    {
    String[] files = new String[] {"artifact-provider-config.xml"};
    ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(files);
    ArtifactProvider artifactMgr = (ArtifactProvider)appContext.getBean("artifactProv ider");
    System.out.println("Artifact:" + artifactMgr.getArtifact());
    }
    }

    Results:
    Exception in thread "main" java.lang.IllegalStateException: receive is not supported, because no pollable reply channel has been configured
    at org.springframework.util.Assert.state(Assert.java: 384)
    at org.springframework.integration.gateway.MessagingG atewaySupport.receive(MessagingGatewaySupport.java :197)
    at org.springframework.integration.gateway.GatewayPro xyFactoryBean.invokeGatewayMethod(GatewayProxyFact oryBean.java:294)
    at org.springframework.integration.gateway.GatewayPro xyFactoryBean.doInvoke(GatewayProxyFactoryBean.jav a:269)
    at org.springframework.integration.gateway.GatewayPro xyFactoryBean.invoke(GatewayProxyFactoryBean.java: 260)
    at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :172)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:202)
    at $Proxy0.getArtifact(Unknown Source)
    at TestApp.main(TestApp.java:12)

  5. #5
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    You have a method on the Gateway that takes no arguments. This means that you are attempting to poll a Message from the channel (not send message to the channel - think reverse). This means that the request-channel must be Pollable Channel (QueueChannel)
    Code:
    <integration:channel id="request">
         <integration:queue/>
    </integration:channe>

  6. #6
    Join Date
    May 2011
    Location
    Austin TX
    Posts
    25

    Default

    Made the changes and get the same error. I guess I don't understand why I need to poll in this situation. I want my gateway to trigger a service-activator. If I add an argument to the method, everything works fine. I don't understand why the presence or omission of a message's payload would cause me to have to change the communication structure between the two sides.

    Here is my modified configuration:

    <integrationoller id="poller" fixed-rate="1000" default="true"/>

    <integration:channel id="request">
    <integration:queue/>
    </integration:channel>
    <integration:channel id="reply">
    </integration:channel>

    <integration:gateway id="artifactProvider"
    service-interface="com.pb.spectrum.test.spring_integration _test.sample.ArtifactProvider">
    <integration:method name="getArtifact"
    request-channel="request"
    reply-channel="reply"/>
    </integration:gateway>

    <integration:service-activator input-channel="request" output-channel="reply" ref="artifactManager" method="getArtifact"/>
    <bean id="artifactManager" class="com.pb.spectrum.test.spring_integration_tes t.sample.ArtifactManager"/>

  7. #7

    Default

    Any solution to this type of problem?

  8. #8
    Join Date
    May 2011
    Location
    Austin TX
    Posts
    25

    Default

    I have not gotten an answer as to how to handle this situation.

  9. #9
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Sorry, but some times its hard to keep track, but we do want to help.
    Could you possibly create a standalone sample that you can zip up and attach to this forum? I know you have provided a lot of details, but the reproducible sample would give some starting point.

  10. #10
    Join Date
    May 2011
    Location
    Austin TX
    Posts
    25

    Default Test Application

    I've included a sample test app that demonstrates what I am trying to do. I've included in the sample, a call to a method with a param (this works) and a call to one with no params (this doesn't work).

    I'm really looking for a couple of things. First, I'd just like to understand why the communication mechanism needs to change between caller/callee when a method has a parameter vs when it doesn't. And second, based on the answer to the first, how do I get a no-param method to work. In my scenario, the caller needs to initiate the communication vs. being able to poll and react.

    I am more than happy to provide any other information you may need. Thank you for the support you have provided.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •