Results 1 to 2 of 2

Thread: SpringIntegration: Service-Activator not invoking method - no eligible methods error.

  1. #1
    Join Date
    Oct 2011
    Posts
    3

    Default SpringIntegration: Service-Activator not invoking method - no eligible methods error.

    I want to read Message from a RabbitMQ Queue > Use Service-Activator to invoke a Service.
    But following exception:
    ...
    Caused by: java.lang.IllegalArgumentException: Target object of type [class org.springframework.integration.service.MessageExa miner] has no eligible methods for handling Messages.


    The relevant config section is:

    Code:
    <int-amqp:inbound-channel-adapter channel="fromRabbit" queue-names="si.test.queue" mapped-request-headers="whatever" connection-factory="connectionFactory" />
        <int:service-activator input-channel="fromRabbit" output-channel="whatever"
                   ref="msgService" method="checkMsg1"/>
    
         <bean id="msgService" class="com.whatever.MsgService"/>
    The MsgService Class is:

    Code:
    public class MsgService{
    //Does not work!
    public void checkMsg1( @Payload String s) {
             System.out.println("The Payload is: " +s);      
         }
    
    //Does not work!
    public void checkMsg2( Message inboundMessage) {
         //...
    }
    Any ideas?
    Last edited by jasper2000; Dec 20th, 2012 at 10:57 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,017

    Default

    Please use [ code ] .[ /code ] tags - no spaces inside brackets - around code and config.

    Is the producer setting a content_type property on the message? Setting it to 'text/plain' will cause the payload to be a String; otherwise it will be a byte[].
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

Tags for this Thread

Posting Permissions

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