Versions Compared

Key

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

...

This snippet shows how to create a proxy for a service interface that sends requests to a direct endpoint and is also able to receive receives the response.

Code Block
Endpoint startEndpoint = context.getEndpoint("direct:customerServiceClient");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
CustomerService proxy = ProxyHelper.createProxy(startEndpoint, classLoader, CustomerService.class);
GetCustomersByNameResponse response = proxy.getCustomersByName(new GetCustomersByName());

...

Using the following route sets up a webservice server that listens on jms queue customerServiceQueue and processes requests
using the class CustomerServiceImpl. The customerServiceImpl of course should implement the interface CustomerService. Instead of directly
instantiating the server class it could of course be defined in a spring context as a regular bean.

...