Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-601

@handler is ignored

    XMLWordPrintable

Details

    Description

      In the attached example, we have a route that does not specify a method name:

                      from(this.emailScanner.getInboxUri()).
                      choice().
                              when(this.emailScanner).
      //fails and uses matches method
                                              bean(this.emailScanner).
      // works                        
      //                                      bean(this.emailScanner, "processMessageWithAttachments").
      
      
      
              @Handler
              public List<Message> processMessageWithAttachments(Message message) {
                      System.out.println("SUSAN withAttachemnets ....");
                      String subject = (String) message.getHeader(SUBJECT);
                      if(this.log.isInfoEnabled()) {
      
      

      As you can see the processMessageWithAttachments has the @Handler notation, however, it seems to be ignored. The test will fail when the method name is not provided as it uses another one by default. Here is the good output with some extra debugging:

      SUSAN custvalidinBMS ....
      SUSAN withAttachemnets ....   <=== handler guy
      SUSAN generateMetaData ....
      SUSAN generateBodyMessage ....
      SUSAN isattachmentValid ....
      
      

      And when it fails:

      SUSAN custvalidinBMS ....
      *** SUSAN matches ....
      SUSAN custvalid ....
      SUSAN custvalidInCRM ...
      
      

      Just goes to the wrong method for some reason.

      Test case is attached. To run it's just mvn:test

      Attachments

        Activity

          People

            cibsen@redhat.com Claus Ibsen
            rhn-support-sjavurek Susan Javurek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: