Package org.axonframework.commandhandling.distributed.jgroups

Examples of org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector


        // 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.
View Full Code Here

TOP

Related Classes of org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.