Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
ServiceMixClient client = new ServiceMixClientFacade(context);

Using ClientFactory

Starting from 3.0-M3, you can retrieve a ClientFactory from JNDI.

Code Block
langjava

ClientFactory factory = new InitialContext().lookup(ClientFactory.DEFAULT_JNDI_NAME);
ServiceMixClient client = factory.createClient();
...
client.close();

Note that creating client is somewhat expensive, so it's best to create a client once and reuse it.