1 Reply Latest reply on Jan 27, 2012 6:36 AM by psomogyvari

    Setting composer-class property on jms-listener causes ESB file validation error

    psomogyvari

      Hello there!

       

       

      I'm using Jboss ESB 4.10 and read a lot about exception handling and how it is done by now.

      I know that a custom composer class can be defined for my gateway (which receives ESB-unaware messages) and in that custom composer I can set the faultTo of the call.

      The problem is that the posts I read about this topic are mainly 3-4 years old and I'm afraid they are quite outdated since when I try to assign a custom composer to my JMS listener in the mentioned way, it simply runs to validation error during deployment.

       

      So the JMS listener definition looks like this (its a working esb without the property custom composer of course)

       

      <jms-listener busidref="omitted_for_security_reasonsl" is-gateway="true" name="omitted_for_security_reasons">

         <jms-message-filter dest-name="omitted_for_security_reasons" dest-type="QUEUE" transacted="false"/>

         <property name="composer-class" value="MyMessageComposer"></property>

      </jms-listener>

       

      And the validation error message which i got from eclipse (the later one during deployment is not too talkative)

      "cvc-complex-type.2.4.d: Invalid content was found starting with element 'property'. No child element is expected at this point."

       

      The MyMessageComposer looks like this:

      public class MyMessageComposer extends AbstractMessageComposer<Object> {

          @Override

          protected void populateMessage(Message message, Object payload)

                  throws MessageDeliverException {

                      System.out.println("Payload is :" + payload.toString());

                  message.getBody().add(payload);   

          }

      }

       

      For a possible solution I could think about creating a proxy service which connects to the gateway and in a custom action does nothing but setting faultTo of the call and then invokes the service I'm in trouble with now, but this sounds like a little bit of hack to me.

       

      Please explain me the workaround for the exception handling with the custom message composer approach and also some opinion about the proxy service idea would be nice.

      Thanks a lot in advance!

       

       

      Regards,

      Peter

        • 1. Re: Setting composer-class property on jms-listener causes ESB file validation error
          psomogyvari

          I was able to resolve this issue by modifying my jboss-esb.xml NOT directly but strictly from the Jboss ESB Editor (eclipse).

          When I made the property settings on the jms-listeners from the editor the output was exactly the same in the source file, but the validation error did not occured.

          I guess theres some schema file generation in the background when you edit the jboss-esb.xml with the editor which of course does not happen in case you just edit the plain xml.

          Hope this will help others who ran into this.