Distributed command bus

788 views
Skip to first unread message

radha bhuyar

unread,
May 2, 2014, 1:58:28 AM5/2/14
to axonfr...@googlegroups.com
Hi ,

I am using Axon Framework and trying some example using distributed command bus.
I have 2 Aggregates 1>ToDoItem  2>AnotherToDoItem
ToDoItem aggregate have two commands 1>CreateToDoItemCommand 2>MarkCompletedCommand
CaseAggregate have one command 1>CreateAnotherToDoItemCommand
When I run this code getting following result:

Please enter the load factor to join with: [100]
1
Using a load factor 1 when connecting to the cluster.
GossipRouter started at Wed Apr 30 18:11:43 IST 2014
Listening on port 12001 bound on address 0.0.0.0/0.0.0.0
Backlog is 1000, linger timeout is 2000, and read timeout is 0
35 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@64482923: startup date [Wed Apr 30 18:11:44 IST 2014]; root of context hierarchy
72 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [distributed-config.xml]
406 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)' of type [class org.axonframework.contextsupport.spring.SpringContextParameterResolverFactoryBuilder$ClasspathParameterResolverFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
410 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)' of type [class org.axonframework.common.annotation.ClasspathParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
411 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)#1' of type [class org.axonframework.common.annotation.SpringBeanParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
429 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '__axon-parameter-resolver-factory' of type [class org.axonframework.contextsupport.spring.ApplicationContextLookupParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
429 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '__axon-parameter-resolver-factory' of type [class org.axonframework.common.annotation.MultiParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
448 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@28787c16: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,taskExecutor,commandBus,commandGateway,eventStore,eventBus,toDoRepository,__axon-parameter-resolver-factory,org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean#0,caseRepository,org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean#1,jGroupsConnector,jGroupsConnector1,__axon-annotation-command-handler-bean-post-processor,__axon-annotation-event-listener-bean-post-processor,org.axonframework.quickstart.annotated.ToDoEventHandler#0,org.axonframework.quickstart.annotated.CaseActiveEventHandler#0,org.axonframework.serializer.xml.XStreamSerializer#0]; root of factory hierarchy
453 [main] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService  'taskExecutor'
Apr 30, 2014 6:11:44 PM org.jgroups.logging.JDKLogImpl info
INFO: UFC is not needed (and can be removed) as we're running on a TCP transport
Apr 30, 2014 6:11:44 PM org.jgroups.logging.JDKLogImpl info
INFO: UFC is not needed (and can be removed) as we're running on a TCP transport
927 [main] INFO org.springframework.context.support.DefaultLifecycleProcessor - Starting beans in phase 0
930 [main] INFO org.springframework.context.support.DefaultLifecycleProcessor - Starting beans in phase 2147483647

-------------------------------------------------------------------
GMS: address=IND-PNE3DW70399-48269, cluster=myCluster, physical address=127.0.0.1:7800
-------------------------------------------------------------------
2503 [Incoming-1,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - Local segment successfully joined the distributed command bus

-------------------------------------------------------------------
GMS: address=IND-PNE3DW70399-78, cluster=myCluster, physical address=127.0.0.1:7801
-------------------------------------------------------------------
2541 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - New member detected: [IND-PNE3DW70399-78]. Sending it my configuration.
2542 [INT-1,myCluster,IND-PNE3DW70399-78] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-48269 joined with load factor: 1
2542 [main] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - New member detected: [IND-PNE3DW70399-48269]. Sending it my configuration.
2543 [INT-1,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-78 joined with load factor: 1
2548 [Incoming-1,myCluster,IND-PNE3DW70399-78] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - Local segment successfully joined the distributed command bus
2548 [INT-1,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-78 joined with load factor: 1
Please enter the number of times to send commands: [1]
2
Sending 2 times the commands to the cluster.
Command Generator Thread: main
Command Generator Thread: main
Received AnotherToDoItemEvent on thread named
6771 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateAnotherToDoItemCommand
Received ToDoItemCreatedEvent on thread named Incoming-2,myCluster,IND-PNE3DW70399-48269
We've got something to do: Check if it really works! (b0221156-f2e8-4558-9e47-d19e98272fb8, created at 30-4-2014 18:11)
6777 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
Received ToDoItemCreatedEvent on thread named Incoming-2,myCluster,IND-PNE3DW70399-48269
We've got something to do: Think about the next steps! (e8669f4d-a150-4925-bd86-690d58068827, created at 30-4-2014 18:11)
6803 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
Received ToDoItemCompletedEvent on thread named Incoming-2,myCluster,IND-PNE3DW70399-48269
We've completed the task with id b0221156-f2e8-4558-9e47-d19e98272fb8
6847 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.MarkCompletedCommand
Received AnotherToDoItemEvent on thread named
6855 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateAnotherToDoItemCommand
Received ToDoItemCreatedEvent on thread named Incoming-2,myCluster,IND-PNE3DW70399-48269
We've got something to do: Check if it really works! (856f8691-9f97-4e29-a852-8d9500455dc0, created at 30-4-2014 18:11)
6862 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
Received ToDoItemCreatedEvent on thread named Incoming-2,myCluster,IND-PNE3DW70399-48269
6878 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
We've got something to do: Think about the next steps! (20352fb1-d42f-4812-90d3-0c0f01ff3289, created at 30-4-2014 18:11)
Received ToDoItemCompletedEvent on thread named Incoming-2,myCluster,IND-PNE3DW70399-48269
We've completed the task with id 856f8691-9f97-4e29-a852-8d9500455dc0
6901 [Incoming-2,myCluster,IND-PNE3DW70399-48269] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.MarkCompletedCommand

As you can see all the commands are getting called from the same segment.
How i can distrubute commands on differnt segments?
Can someone provide me running example of this?

Allard Buijze

unread,
May 2, 2014, 2:25:26 AM5/2/14
to axonfr...@googlegroups.com
Hi,

I see you're choosing 1 as the number of segments. That's very low and could be the cause of an unbalance. 100 is a good default value. Do all the commands have an @TargetAggregateIdentifier annnotation on the field (or getter) the contains the aggregate identifier?

Cheers,

Allard
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

radha bhuyar

unread,
May 2, 2014, 4:02:22 AM5/2/14
to axonfr...@googlegroups.com

yes all the commands have an @TargetAggregateIdentifier annnotation on the fields.  Now M using 100 as a load factor but getting the same response.
I want output to be  CreateToDoItemCommand and MarkCompletedCommand to be distributed on one segment and CreateAnotherToDoItemCommand on another segment .
How could i achieve this using distributed command bus?

Allard Buijze

unread,
May 2, 2014, 4:16:05 AM5/2/14
to Axon Framework Users
The only way to achieve that, is to make sure that on one node, you only register command handlers for CreateToDoItemCommand and MarkCompletedCommand, and on the other CreateAnotherToDoItemCommand . Axon will distribute load to all servers accepting a specific type of command. If multiple nodes accept the same command type, the distribution is based on the aggregate identifier.

Cheers,

Allard


--

radha bhuyar

unread,
May 2, 2014, 5:20:10 AM5/2/14
to axonfr...@googlegroups.com
Application context

<beans xmlns="http://www.springframework.org/schema/beans"
   
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:axon="http://www.axonframework.org/schema/core"
   
xmlns:context="http://www.springframework.org/schema/context"
   
xmlns:task="http://www.springframework.org/schema/task"
   
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.axonframework.org/schema/core http://www.axonframework.org/schema/axon-core.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"
>
   
<!-- Load system properties for the loadFactor -->
   
<context:property-placeholder />

   
<task:annotation-driven />

   
<bean id="taskExecutor"
       
class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
       
<property name="corePoolSize" value="5" />
       
<property name="maxPoolSize" value="10" />
       
<property name="queueCapacity" value="25" />
   
</bean>

   
<!-- Setup the distributed command bus using the Special JGroupsConnector
        factory bean -->

   
<bean id="commandBus"
       
class="org.axonframework.commandhandling.distributed.DistributedCommandBus">
       
<constructor-arg ref="jGroupsConnector" />
   
</bean>

   
<!-- Setup the gateway using the distributed command bus -->
   
<bean id="commandGateway"
       
class="org.axonframework.commandhandling.gateway.CommandGatewayFactoryBean">
       
<property name="commandBus" ref="commandBus" />
   
</bean>

   
<axon:command-bus id="commandBus1"/>

   
<axon:filesystem-event-store id="eventStore"
       
base-dir="events" />

   
<axon:event-bus id="eventBus" />

   
<axon:event-sourcing-repository id="toDoRepository"
       
aggregate-type="org.axonframework.quickstart.annotated.ToDoItem" />

   
<axon:aggregate-command-handler
       
aggregate-type="org.axonframework.quickstart.annotated.ToDoItem"
       
repository="toDoRepository" command-bus="commandBus1" />

     
<axon:command-bus id="commandBus2"/>

   
<axon:event-sourcing-repository id="anotherToDoItemRepository"
       
aggregate-type="org.axonframework.quickstart.annotated.AnotherToDoItem" />

   
<axon:aggregate-command-handler
       
aggregate-type="org.axonframework.quickstart.annotated.AnotherToDoItem"
       
repository="anotherToDoItemRepository" command-bus="commandBus2" />

   
<!-- Setup the factory bean for the JGroupsConnector -->
   
<bean id="jGroupsConnector"
       
class="org.axonframework.commandhandling.distributed.jgroups.JGroupsConnectorFactoryBean">
       
<property name="configuration" value="tcp_gossip.xml" />
       
<property name="clusterName" value="myCluster" />
       
<property name="loadFactor" value="${loadFactor}" />
         
<property name="localSegment" ref="commandBus1"/>
   
</bean>
   

   
<bean id="jGroupsConnector1"
       
class="org.axonframework.commandhandling.distributed.jgroups.JGroupsConnectorFactoryBean">
       
<property name="configuration" value="tcp_gossip.xml" />
       
<property name="clusterName" value="myCluster" />
       
<property name="loadFactor" value="${loadFactor}" />
       
<property name="localSegment" ref="commandBus2"/>
   
</bean>

   
<!-- Setup initialization of beans using annotations -->
   
<axon:annotation-config />

   
<!-- The bean containing the command handler methods <bean class="org.axonframework.quickstart.RunDistributedCommandBus$ToDoLoggingCommandHandler"/> -->

   
<bean class="org.axonframework.quickstart.annotated.ToDoEventHandler" />
   
<bean class="org.axonframework.quickstart.annotated.anotherToDoItemEventHandler"/>
   
<!-- Serializer used by the jgroups connector -->
   
<bean class="org.axonframework.serializer.xml.XStreamSerializer" />
</beans>
when i run my application getting following exception

Please enter the load factor to join with: [100]
100
Using a load factor 100 when connecting to the cluster.
GossipRouter started at Fri May 02 14:42:36 IST 2014

Listening on port 12001 bound on address 0.0.0.0/0.0.0.0
Backlog is 1000, linger timeout is 2000, and read timeout is 0
34 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@64482923: startup date [Fri May 02 14:42:36 IST 2014]; root of context hierarchy
71 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [distributed-config.xml]
409 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)' of type [class org.axonframework.contextsupport.spring.SpringContextParameterResolverFactoryBuilder$ClasspathParameterResolverFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
413 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)' of type [class org.axonframework.common.annotation.ClasspathParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
414 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)#1' of type [class org.axonframework.common.annotation.SpringBeanParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
432 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '__axon-parameter-resolver-factory' of type [class org.axonframework.contextsupport.spring.ApplicationContextLookupParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
432 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '__axon-parameter-resolver-factory' of type [class org.axonframework.common.annotation.MultiParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
451 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@540984b: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,taskExecutor,commandBus,commandGateway,commandBus1,eventStore,eventBus,toDoRepository,__axon-parameter-resolver-factory,org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean#0,commandBus2,caseRepository,org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean#1,jGroupsConnector,jGroupsConnector1,__axon-annotation-command-handler-bean-post-processor,__axon-annotation-event-listener-bean-post-processor,org.axonframework.quickstart.annotated.ToDoEventHandler#0,org.axonframework.quickstart.annotated.CaseActiveEventHandler#0,org.axonframework.serializer.xml.XStreamSerializer#0]; root of factory hierarchy
456 [main] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService  'taskExecutor'
May 2, 2014 2:42:36 PM org.jgroups.logging.JDKLogImpl info
INFO
: UFC is not needed (and can be removed) as we're running on a TCP transport
May 2, 2014 2:42:36 PM org.jgroups.logging.JDKLogImpl info

INFO: UFC is not needed (and can be removed) as we'
re running on a TCP transport
939 [main] INFO org.springframework.context.support.DefaultLifecycleProcessor - Starting beans in phase 0
942 [main] INFO org.springframework.context.support.DefaultLifecycleProcessor - Starting beans in phase 2147483647

-------------------------------------------------------------------
GMS
: address=IND-PNE3DW70399-64527, cluster=myCluster, physical address=127.0.0.1:7800
-------------------------------------------------------------------
2528 [Incoming-1,myCluster,IND-PNE3DW70399-64527] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - Local segment successfully joined the distributed command bus

-------------------------------------------------------------------
GMS
: address=IND-PNE3DW70399-30317, cluster=myCluster, physical address=127.0.0.1:7801
-------------------------------------------------------------------
2563 [Incoming-2,myCluster,IND-PNE3DW70399-64527] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - New member detected: [IND-PNE3DW70399-30317]. Sending it my configuration.
2570 [INT-1,myCluster,IND-PNE3DW70399-30317] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-64527 joined with load factor: 100
2571 [main] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - New member detected: [IND-PNE3DW70399-64527]. Sending it my configuration.
2579 [INT-1,myCluster,IND-PNE3DW70399-64527] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-30317 joined with load factor: 100
2604 [Incoming-1,myCluster,IND-PNE3DW70399-30317] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - Local segment successfully joined the distributed command bus
2605 [INT-2,myCluster,IND-PNE3DW70399-64527] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-30317 joined with load factor: 100

Please enter the number of times to send commands: [1]
2
Sending 2 times the commands to the cluster.
Command Generator Thread: main
5589 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.CreateAnotherToDoItemCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:44)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
5591 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.CreateToDoItemCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:45)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
5592 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.CreateToDoItemCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:47)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
5593 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.MarkCompletedCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:49)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
Command Generator Thread: main
5595 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.CreateAnotherToDoItemCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:44)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
5596 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.CreateToDoItemCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:45)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
5597 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.CreateToDoItemCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:47)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)
5598 [main] ERROR org.axonframework.commandhandling.distributed.DistributedCommandBus - An error occurred while trying to dispatch a command on the DistributedCommandBus
org
.axonframework.commandhandling.distributed.CommandDispatchException: No node known to accept org.axonframework.quickstart.api.MarkCompletedCommand
    at org
.axonframework.commandhandling.distributed.jgroups.JGroupsConnector.send(JGroupsConnector.java:207)
    at org
.axonframework.commandhandling.distributed.DistributedCommandBus.dispatch(DistributedCommandBus.java:86)
    at org
.axonframework.commandhandling.gateway.AbstractCommandGateway.sendAndForget(AbstractCommandGateway.java:86)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:407)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$DispatchOnInvocationHandler.invoke(GatewayProxyFactory.java:367)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$FireAndForget.invoke(GatewayProxyFactory.java:570)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnTimeout.invoke(GatewayProxyFactory.java:475)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$NullOnInterrupted.invoke(GatewayProxyFactory.java:493)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$WrapNonDeclaredCheckedExceptions.invoke(GatewayProxyFactory.java:450)
    at org
.axonframework.commandhandling.gateway.GatewayProxyFactory$GatewayInvocationHandler.invoke(GatewayProxyFactory.java:350)
    at $Proxy12
.send(Unknown Source)
    at org
.axonframework.quickstart.CommandGenerator.sendCommands(CommandGenerator.java:49)
    at org
.axonframework.quickstart.RunDistributedCommandBusWithSpring.main(RunDistributedCommandBusWithSpring.java:56)



Allard Buijze

unread,
May 2, 2014, 5:51:22 AM5/2/14
to Axon Framework Users
apparently, there is no CommandHandler for org.axonframework.quickstart.api.CreateAnotherToDoItemCommand on any of the nodes.
You've got 3 command buses configured. "commandBus" is the distributed one, with "commandBus1" as local segment. However, the commandHandler registering CreateAnotherToDoItemCommand is registered to commandBus2, which is not part of the distributed command bus. Thus, commands of that type sent to "commandBus" cannot be handled.

Try creating two instances of DistributedCommandBus, each with a different connector. If the connectors use the same clusterName, they will find eachother.

Cheers,

Allard


radha bhuyar

unread,
May 2, 2014, 6:55:53 AM5/2/14
to axonfr...@googlegroups.com
Thanks Allard.

Now i have created
<!-- Setup the distributed command bus using the Special JGroupsConnector
        factory bean -->
    <bean id="commandBus"
        class="org.axonframework.commandhandling.distributed.DistributedCommandBus">
        <constructor-arg ref="jGroupsConnector" />
    </bean>
   
    <!-- Setup the distributed command bus using the Special JGroupsConnector
        factory bean -->
    <bean id="commandBus1"
        class="org.axonframework.commandhandling.distributed.DistributedCommandBus">
        <constructor-arg ref="jGroupsConnector1" />
    </bean>

radha bhuyar

unread,
May 2, 2014, 7:02:10 AM5/2/14
to axonfr...@googlegroups.com
Thanks Allard.

I have created two instances of Distributed command bus and its working fine but now events are not getting published.
Output :

Please enter the load factor to join with: [100]
100
Using a load factor 100 when connecting to the cluster.
GossipRouter started at Fri May 02 16:05:09 IST 2014

Listening on port 12001 bound on address 0.0.0.0/0.0.0.0
Backlog is 1000, linger timeout is 2000, and read timeout is 0
34 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@64482923: startup date [Fri May 02 16:05:09 IST 2014]; root of context hierarchy
71 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading XML bean definitions from class path resource [distributed-config.xml]
407 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)' of type [class org.axonframework.contextsupport.spring.SpringContextParameterResolverFactoryBuilder$ClasspathParameterResolverFactoryBean] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
411 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)' of type [class org.axonframework.common.annotation.ClasspathParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
412 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '(inner bean)#1' of type [class org.axonframework.common.annotation.SpringBeanParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
430 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '__axon-parameter-resolver-factory' of type [class org.axonframework.contextsupport.spring.ApplicationContextLookupParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
430 [main] INFO org.springframework.context.support.ClassPathXmlApplicationContext - Bean '__axon-parameter-resolver-factory' of type [class org.axonframework.common.annotation.MultiParameterResolverFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
449 [main] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13b33a0e: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,org.springframework.context.annotation.internalAsyncAnnotationProcessor,org.springframework.context.annotation.internalScheduledAnnotationProcessor,taskExecutor,commandBus,commandBus1,commandGateway,eventStore,eventBus,toDoRepository,__axon-parameter-resolver-factory,org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean#0,caseRepository,org.axonframework.commandhandling.annotation.AggregateAnnotationCommandHandlerFactoryBean#1,jGroupsConnector,jGroupsConnector1,__axon-annotation-command-handler-bean-post-processor,__axon-annotation-event-listener-bean-post-processor,org.axonframework.serializer.xml.XStreamSerializer#0]; root of factory hierarchy
454 [main] INFO org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService  'taskExecutor'
May 2, 2014 4:05:10 PM org.jgroups.logging.JDKLogImpl info
INFO
: UFC is not needed (and can be removed) as we're running on a TCP transport
May 2, 2014 4:05:10 PM org.jgroups.logging.JDKLogImpl info

INFO: UFC is not needed (and can be removed) as we'
re running on a TCP transport
859 [main] INFO org.springframework.context.support.DefaultLifecycleProcessor - Starting beans in phase 0
859 [main] INFO org.springframework.context.support.DefaultLifecycleProcessor - Starting beans in phase 2147483647

-------------------------------------------------------------------
GMS
: address=IND-PNE3DW70399-49218, cluster=myCluster, physical address=127.0.0.1:7800
-------------------------------------------------------------------
2452 [Incoming-1,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - Local segment successfully joined the distributed command bus

-------------------------------------------------------------------
GMS
: address=IND-PNE3DW70399-15185, cluster=myCluster, physical address=127.0.0.1:7801
-------------------------------------------------------------------
2483 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - New member detected: [IND-PNE3DW70399-15185]. Sending it my configuration.
2489 [INT-1,myCluster,IND-PNE3DW70399-15185] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-49218 joined with load factor: 100
2490 [main] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - New member detected: [IND-PNE3DW70399-49218]. Sending it my configuration.
2497 [INT-1,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-15185 joined with load factor: 100
2519 [INT-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - IND-PNE3DW70399-15185 joined with load factor: 100
2519 [Incoming-1,myCluster,IND-PNE3DW70399-15185] INFO org.axonframework.commandhandling.distributed.jgroups.JGroupsConnector - Local segment successfully joined the distributed command bus
Please enter the number of times to send commands: [1]
2
Sending 2 times the commands to the cluster.
Command Generator Thread: main
Command Generator Thread: main
5138 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
5138 [Incoming-2,myCluster,IND-PNE3DW70399-15185] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateAnotherToDoItemCommand
5142 [Incoming-2,myCluster,IND-PNE3DW70399-15185] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateAnotherToDoItemCommand
5144 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
5177 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.MarkCompletedCommand
5180 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
5193 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.CreateToDoItemCommand
5206 [Incoming-2,myCluster,IND-PNE3DW70399-49218] INFO org.axonframework.commandhandling.callbacks.LoggingCallback - Command executed successfully: org.axonframework.quickstart.api.MarkCompletedCommand



Allard Buijze

unread,
May 2, 2014, 7:19:30 AM5/2/14
to Axon Framework Users
In your configuration, it seems that you register the command handlers (the aggregate-command-handler) with the command bus instances that you use as local segment. You should register them with the appropriate distributed command bus instance. In fact, if the local segment is just a default command bus, you don't even need to configure it at all.

Check out the QuickStart samples to see how the wiring is done:
and

Cheers,

Allard


radha bhuyar

unread,
May 2, 2014, 7:45:07 AM5/2/14
to axonfr...@googlegroups.com
My commands are getting published on different segments now but events are not getting published..

<beans xmlns="http://www.springframework.org/schema/beans"
   
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:axon="http://www.axonframework.org/schema/core"
   
xmlns:context="http://www.springframework.org/schema/context"
   
xmlns:task="http://www.springframework.org/schema/task"
   
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
       http://www.axonframework.org/schema/core http://www.axonframework.org/schema/axon-core.xsd
       http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
       http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"
>
   
<!-- Load system properties for the loadFactor -->
   
<context:property-placeholder />

   
<task:annotation-driven />

   
<bean id="taskExecutor"
       
class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
       
<property name="corePoolSize" value="5" />
       
<property name="maxPoolSize" value="10" />

       
<property name="queueCapacity" value="25" />

   
</bean>

   
<!-- Setup the distributed command bus using the Special JGroupsConnector
        factory bean -->

   
<bean id="commandBus"
       
class="org.axonframework.commandhandling.distributed.DistributedCommandBus">
       
<constructor-arg ref="jGroupsConnector" />
   
</bean>
   
   
<!-- Setup the distributed command bus using the Special JGroupsConnector
        factory bean -->

   
<bean id="commandBus1"
       
class="org.axonframework.commandhandling.distributed.DistributedCommandBus">
       
<constructor-arg ref="jGroupsConnector1" />
   
</bean>


   
<!-- Setup the gateway using the distributed command bus -->

   
<bean id="commandGateway"
       
class="org.axonframework.commandhandling.gateway.CommandGatewayFactoryBean">
       
<property name="commandBus" ref="commandBus" />
   
</bean>


   
<!--  <axon:command-bus id="commandBus1"/>-->


   
<axon:filesystem-event-store id="eventStore"
       
base-dir="events" />

   
<axon:event-bus id="eventBus" />

   
<axon:event-sourcing-repository id="toDoRepository"
       
aggregate-type="org.axonframework.quickstart.annotated.ToDoItem" />

   
<axon:aggregate-command-handler
       
aggregate-type="org.axonframework.quickstart.annotated.ToDoItem"

       
repository="toDoRepository" command-bus="commandBus" />

   
<!-- <axon:command-bus id="commandBus2"/> -->

   
<axon:event-sourcing-repository id="caseRepository"

       
aggregate-type="org.axonframework.quickstart.annotated.AnotherToDoItem" />

   
<axon:aggregate-command-handler
       
aggregate-type="org.axonframework.quickstart.annotated.AnotherToDoItem"

       
repository="caseRepository" command-bus="commandBus1" />


   
<!-- Setup the factory bean for the JGroupsConnector -->
   
<bean id="jGroupsConnector"
       
class="org.axonframework.commandhandling.distributed.jgroups.JGroupsConnectorFactoryBean">
       
<property name="configuration" value="tcp_gossip.xml" />
       
<property name="clusterName" value="myCluster" />
       
<property name="loadFactor" value="${loadFactor}" />

       
<!--  <property name="localSegment" ref="commandBus1"/> -->

   
</bean>
   

   
<bean id="jGroupsConnector1"
       
class="org.axonframework.commandhandling.distributed.jgroups.JGroupsConnectorFactoryBean">
       
<property name="configuration" value="tcp_gossip.xml" />
       
<property name="clusterName" value="myCluster" />
       
<property name="loadFactor" value="${loadFactor}" />

       
<!-- <property name="localSegment" ref="commandBus2"/> -->

   
</bean>

   
<!-- Setup initialization of beans using annotations -->
   
<axon:annotation-config />

   
<!-- The bean containing the command handler methods
    <bean class="org.axonframework.quickstart.RunDistributedCommandBus$ToDoLoggingCommandHandler"/>

    <bean class="org.axonframework.quickstart.annotated.ToDoEventHandler" />
    <bean class="org.axonframework.quickstart.annotated.AnotherToDoEventHandler"/>-->

Allard Buijze

unread,
May 2, 2014, 8:10:53 AM5/2/14
to Axon Framework Users
DId you have the EventHandler beans commented out when you ran the test?


radha bhuyar

unread,
May 2, 2014, 8:33:01 AM5/2/14
to axonfr...@googlegroups.com
yes it was my mistake.. :) now my code is working as expected..

Thanks Allard for your inputs.
Reply all
Reply to author
Forward
0 new messages