Announcement Announcement Module
Collapse
No announcement yet.
no pollable reply channel has been configured Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I still don't understand how your use case maps to Messaging and Spring Integration. As i said before you are receiving the next Message from the queue, nothing more.

    Comment


    • #17
      I tried the recommendations and still have problems. Without commenting out this line:

      Code:
        
      <!--  integration:service-activator input-channel="request.noparam"  output-channel="reply.noparam" ref="artifactManager"  method="getArtifact"/-->
      I get the error:
      Code:
      SEVERE: org.springframework.integration.MessageDeliveryException: Dispatcher has no subscribers.
          at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:104)
          at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
          at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
          at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
          at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
          at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
          at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
          at  org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
          at  org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
          at  org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
          at  org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
          at  org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
          at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
          at org.springframework.integration.endpoint.PollingConsumer.doPoll(PollingConsumer.java:70)
          at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
          at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
          at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:207)
          at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
          at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
          at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
          at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:202)
          at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
          at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
          at java.util.concurrent.FutureTask.run(FutureTask.java:138)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
          at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
          at java.lang.Thread.run(Thread.java:619)
      Once this line is commented out, I can run without error, but it doesn't work the way it is supposed to. This recommended solution basically puts a message on a queue and then the gateway reads that value off the queue and totally bypasses the service activator on the other end.

      I apologize for continuing to bother you about this, but it still seems like what I am attempting to do is not that unusual. It seems like I have two possible choices:
      1. Change my API so that I always have a parameter. This seems fundamentally wrong.
      2. Use polling which doesn't seem like it solves the problem at all.

      I understand the implementation determines request, request/response, and response scenarios based on the method signature, but I believe that it would be extremely helpful if a configuration item would be added to let this scenario (ie. no param method) be used in a request/response interaction.

      Comment


      • #18
        That is a whole separate issue. You have service-activator that defines output-channel which is a DirectChannel which has no subscribers. But keep in mind that has no connection to the no-param Gateway method issue.

        Comment


        • #19
          Now I'm really confused. Your previous instructions said to modify the gateway definition to remove the request channel and only have a reply channel. By doing this, it caused the error I included in my last post. But, a service activator requires an input and output channel. If I don't have anything sending my service activator a message, how can it respond?

          All I'm trying to do is trigger a remote service to send me a response. The way I'm understanding this is if my remote service happened to be a webservice, there would be no way to use spring integration to integrate with that method if it doesn't have parameters to send it.

          Comment


          • #20
            If you remote service is a web service than you would issue something like a SOAP request or REST request and we support both via HTTP and WS modules.

            Your original issue was about Gateway interface that has a non-void and no-parameter Method and as I explained this would expose a PPOJO way to pull a message from the QueueChannel. Just to understand my analogy a non-POJO way would be to do this:
            Code:
            QueeuChannel channel = . . . 
            Message message = channel.receive();
            String payload = (String)message.getPayload()
            where with Gateway all you'd need to do is this:
            Code:
            public interface MyGateway{
                 public String foo();
            }
            
            MyGateway gateway = . . .
            String payload = gateway.foo();
            The Service Activator has nothing to do with this gateway unless its output-channel is the QueueChannel from which you are polling Messages with the Gateway.

            All I ma trying to explain is the use case for no-param non-void gateway method and what it means. The assumptions you made in your previous configurations are incorrect and I am trying to explain what is wrong. I hope it helps

            Comment


            • #21
              The Service Activator has nothing to do with this gateway unless its output-channel is the QueueChannel from which you are polling Messages with the Gateway.
              This is exactly what I'm trying to do. I have a gateway whose output channel is the channel that the service activator is listening on and whose reply channel is where the service activator is writing to.

              All I'm trying to do is implement a "getter" method with one side using a gateway and the other using a service-activator. It is a synchronous call and polling won't work. Maybe I'm trying to fit a square peg into a round hole using messaging where a webservice call might be more appropriate, but I wanted to establish a consistent communication mechanism between subsystems and I thought using spring-integration would allow me to do that. I still don't feel like I have a concrete example of how to do this.

              Comment


              • #22
                You can use ws-outbound-gateway to make a webservice call whose output will go to the repolyChannel and downstream and I think that is what you want.
                I'd suggest to look at our samples especially this one: https://github.com/SpringSource/spri...tbound-gateway

                Code:
                <chain input-channel="fahrenheitChannel" output-channel="celsiusChannel">
                		<ws:header-enricher>
                			<ws:soap-action value="http://tempuri.org/FahrenheitToCelsius"/>
                		</ws:header-enricher>
                		<ws:outbound-gateway uri="http://www.w3schools.com/webservices/tempconvert.asmx"/>
                	</chain>
                
                	<!-- The response from the service is logged to the console. -->
                	<stream:stdout-channel-adapter id="celsiusChannel"/>
                As you can see its a basic chain that has header-enricher to enrich a request with SOAP Action header, makes a SOAP request and the output goes to the output-channel which in this sample is logger but you can stick your service-activator and do whatever you want with it.
                Now, the example above is SOAP, you can do the same with REST, just look at 'http' sample

                Comment


                • #23
                  If I understand this correctly, the fahrenheitToCelcius method has a parameter passed to it which falls into the scenario that I already have working.

                  If for instance the exposed method was "getTemperature()", would this still work? And if so, would you have to explicitly send a message on the request channel or could you hide that behind a gateway interface?

                  This is what I want:
                  Subsystem1 -> getTemperature() -> Gateway --> [SOAP or JMS or REST or...] --> ServiceActivator -> SubSystem2.getTemperature() {return 98.6;}

                  This is what it sounds like you are proposing
                  Subsystem1 -> channel.send(new GenericMessage()) --> [SOAP or JMS or REST or...] --> ServiceActivator -> SubSystem2.getTemperature() {return 98.6;}

                  Comment


                  • #24
                    As you said you are still trying to fit square peg in the round hole. If getTemperature is a SOAP service which takes no parameters that so be it. The same for REST where all you might need to do is hit a URL with no parameters, but now that has nothing to do with the GatewayProxyFactoryBean that you were trying to use earlier.
                    So i guess it would be better if you explain your use case outside of scope of what you have tried to do so far.

                    Comment


                    • #25
                      May be this is what you are looking for. We have an issue slated for 2.1.M2 https://jira.springsource.org/browse/INT-2089. Let us know

                      Comment


                      • #26
                        That is exactly what I'm looking for as long as it's not limited to just "send" messages but also able to handle "send/receive" if the method return type is not void.

                        Comment


                        • #27
                          What is the current estimation of when 2.1 will be released?

                          Comment


                          • #28
                            The first Milestone M1 should be shortly (few days). The issue I pointed out is scheduled for M2 so that one wil be several weeks away, but I am sure it will be in the snapshot much quicker than M2 so you can actually try it before M2 is released.

                            Comment


                            • #29
                              Will the new functionality include send/receive or will it strictly be send?

                              Comment


                              • #30
                                Well send/receive is there already. I think in your case since you have a no-arg method it resembles more of a trigger so i think the proper way of describing it would be trigger/receive. If so than the answer is yes, this is what we are discussing

                                Comment

                                Working...
                                X