Consolidation with Loose Coupling

With process transports, program threads within a process can communicate with one another by publishing and subscribing to messages. The main use case for process transports is consolidation of several application processes into one process, to boost performance by decreasing message latency.

To understand the concept of consolidation, consider a purely administrative first step toward the goal of decreasing latency. The administrator can run cooperating application processes on a single host computer, where they can communicate using a shared memory transport.

A second step is analogous, but involves programming. The developer can consolidate the loosely-coupled modules of a distributed application into a single program, where they run in separate threads that communicate using a process transport.

When consolidating application modules, you may retain the same endpoint structure as before consolidation. That is, if two modules each used a separate endpoint name before consolidation, the consolidated program can continue to use the same two endpoint names, and the administrator can bind them both to the same process transport. (Notice that this endpoint structure reflects the loose coupling among the module threads.)

Tip: Avoid Copying Messages

For best performance with a process transport, avoid the need to copy messages:

  • Publish messages to only one subscriber, in one receiving thread. Publishing a message to two or more subscribers in two or more receiving threads requires a separate copy of the message for each receiving thread.
  • Set the publisher property to release messages to send, and set the subscriber property to release messages to callback.