4.2. Configuring a Remoting Service and a Destination

You were introduced to the message broker in the last section. By now, you know that the message broker is the hub of all activity in BlazeDS. The message broker receives and processes messages from the clients to the BlazeDS endpoints and passes them down to the remoting service. It also returns the results to the client using the reverse route. Therefore, almost all communication within BlazeDS gets routed through the message broker. On startup, the message broker is bootstrapped by the message broker Servlet. This activity of bootstrapping and initializing the message broker involves reading the configurations for the associated endpoints, services, destinations, and adapters. Based on the configurations, the associated artifacts and components are instantiated and initialized and hooked on to the message broker.

Such configuration parameters for the message broker and its associated artifacts are specified in the services-config.xml configuration file. This configuration file, by default, resides in the WEB-INF/flex folder within the BlazeDS distribution. As a starting point, the important configuration elements pertaining to a remoting service and a destination are shown in Figure 4-3.

From the earlier chapters, you know that services-config.xml is broken down into multiple XML files for convenience. The common configuration remains in services-config.xml, and the additional XML files contain elements that pertain to the ...

Get Professional BlazeDS: Creating Rich Internet Applications with Flex® and Java® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.