Announcement Announcement Module
Collapse
No announcement yet.
SpringIntegration: Service-Activator not invoking method - no eligible methods error. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 11:57 PM.

  • #2
    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[].

    Comment

    Working...
    X