Package org.axonframework.commandhandling.distributed

Examples of org.axonframework.commandhandling.distributed.DistributedCommandBus


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


        connector1.connect(20);
        connector2.connect(20);
        assertTrue("Failed to connect", connector1.awaitJoined(5, TimeUnit.SECONDS));
        assertTrue("Failed to connect", connector2.awaitJoined(5, TimeUnit.SECONDS));

        DistributedCommandBus bus1 = new DistributedCommandBus(connector1, new AnnotationRoutingStrategy(
                UnresolvedRoutingKeyPolicy.RANDOM_KEY));
        CommandGateway gateway1 = new DefaultCommandGateway(bus1);

        doThrow(new RuntimeException("Mock")).when(serializer).deserialize(argThat(new TypeSafeMatcher<SerializedObject<byte[]>>() {
            @Override
View Full Code Here

        connector = new JGroupsConnector(channel,
                                         "testing",
                                         new SimpleCommandBus(),
                                         new XStreamSerializer());
        dcb = new DistributedCommandBus(connector, new RoutingStrategy() {
            @Override
            public String getRoutingKey(CommandMessage<?> command) {
                return command.getPayload().toString();
            }
        });
View Full Code Here

TOP

Related Classes of org.axonframework.commandhandling.distributed.DistributedCommandBus

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.