// Configure the required components for jgroup, first een channel and serializer
JChannel channel = new JChannel("tcp_gossip.xml");
Serializer serializer = new XStreamSerializer();
// Use the jgroup channel and the serializer to setup the connector to the jgroup cluster
JGroupsConnector connector = new JGroupsConnector(channel, "myCluster", localSegment, serializer);
// Setup the distributed command bus using the connector and the routing strategy
DistributedCommandBus commandBus = new DistributedCommandBus(connector);
// Register the Command Handlers with the command bus using the annotated methods of the object.
AnnotationCommandHandlerAdapter.subscribe(new ToDoLoggingCommandHandler(), commandBus);
// Start the connection to the distributed command bus
connector.connect(loadFactor);
// Load the amount of times to send the commands from the command line or use default 1
Integer numberOfCommandLoops = determineNumberOfCommandLoops();
// and let's send some Commands on the CommandBus.