0 Replies Latest reply on Feb 5, 2010 4:09 PM by Vijay Ratnagiri

    NotifyServices - Consolidating notification targets

    Vijay Ratnagiri Newbie

      Hello,

       

      I was going through the JBoss ESB developers guide and I did notice that JBoss does not recommend using the Notifier to notify ESB aware services. But I see some value in consolidating all the notification targets at one place instead of taking one approach - namely, using the Notifier -- to notify all types of endpoints while using another approach - namely, using the ServiceInvoker from within the action handlers - to notify an ESB aware endpoint.

       

      So, I set about writing a NotifyServices Class that facilitates adding one or more notification targets that are ESB aware services. Here is an example configuration snippet of how you would add:

       

      <target class="NotifyServices">
        <!-- If notification to this service fails, an exception will be thrown
            and an error will be logged. -->
        <logicalEPR category="<exampleCategory2>" name="<exampleName2>" />
        <logicalEPR category="<exampleCategory1>" name="<exampleName1>"
            errorOnFail="false" />
      </target>


      I have unit tested the NotifyServices class and when I supply it with a ConfigTree that would be constructed from the XML in the above snippet, it works great.

       

      Now, the problem is when, I try to actually integration test it by having it be instantiated by the Notifier class in the actual system flow. For some reason, when I say: ConfigTree[] servicesToBeNotified = configTree.getChildren(LOGICAL_EPR_TAG); where LOGICAL_EPR_TAG is public static final String LOGICAL_EPR_TAG = "logicalEPR";, I don't get the expected array. I get an empty array.

       

      I was wondering if someone could help me with this issue. I'll attach the source code for the classes and the unit test.

       

      Thank you very much in advance.