How to use the client api really depends on your location. If you can access the jbi container, you should use the DefaultServiceMixClient. If you are inside a component, you can use the ServiceMixClientFacade. Else you have to use the remote client and enable the jms flow (you can now have both seda and jms flow). Note that activating the jms flow will cluster ServiceMix. If this is not what you want, well, use a binding component ;)
Cheers, Guillaume Nodet On 3/24/06, Charles Souillard <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to create a simple java client which sends an exchange to an > installed component. > I am using SM embeded in a web app. > My problem is all examples I can find in the svn head are based on a > spring xml file which defines the jbi container and at least one component. > This is not conforming to my case as my container is already started and > my components were deployed using SU method. > > I tried creating a client by doing : > > ServiceMixClient client = new RemoteServiceMixClient(); > or > ServiceMixClient = new DefaultServiceMixClient() > > but I get a NPE : > java.lang.NullPointerException > at > org.apache.servicemix.client.DefaultServiceMixClient.createInOutExchange(DefaultServiceMixClient.java:96) > > This line is corresponding to > InOut exchange = getExchangeFactory().createInOutExchange(); > It means getExchangeFactory() returned a null value. > I think this is due to the context value which is null in my case. > I know there is another way to create a client which is : > ServiceMixClient client = new ServiceMixClientFacade(ComponentContext); > > but how can I get a ComponentContext ? > > Thanks, > Charles > >
