1 Reply Latest reply on Feb 26, 2010 4:45 AM by Gert Vanthienen

    easiest way to internally call an NMR endpoint

    JB Gill Newbie

      Hi everyone, I'm a newbie to ServiceMix/FUSE, and have gone through some of the examples and tutorials in trying to evaluate its possible use in my current project.

       

      One concept that is eluding me, however, is how to internally consume an NMR endpoint without  exposing the endpoint externally.  Is there an easy way to do this?  For example, the examples/cxf-nmr example appears to publish its service to the NMR, and I assume not externally.  How can I consume this endpoint from a different  module on the NMR?  Do I have to do the low-level XML message kind of stuff, or is there an easier way, like a JAX-WS-generated client for example?  If so, can someone point me to some examples?

       

      Thanks!

        • 1. Re: easiest way to internally call an NMR endpoint
          Gert Vanthienen Novice

          L.S.,

           

          The CXF NMR example you're referring to, shows you how to publish the JAX-WS endpoint on the NMR.  You can also use the same transport URI in your client bundle for a JAX-WS client, if you add the import elements to that bundle's spring configuration as well.

           

          We also have an NMR component for Apache Camel.  The camel-nmr and cxf-camel-nmr examples show you how you can use it in your Camel routes to connect to the internal NMR endpoint.  You can also use it to glue other kind of endpoints to the NMR, e.g. by doing a from("activemq://some.queue").to("nmr:yourserviceaddress")

           

          Those are the only two bindings we've created for the NMR so far, but feel free to suggest additional things that come to mind.  If you want more specific access to the NMR, you can get a reference to it from your blueprint/spring dm enabled bundle by doing

           

              <reference id="nmr"
                     interface="org.apache.servicemix.nmr.api.NMR" />
          

           

          The API itself to interact with the NMR is pretty straightforward, but we would be glad to provide you with some additional examples there if you need any help with the low-level approach.

           

          Regards,

           

          Gert