Hi,
I am using Axon and am trying to update our system to support the processing of generic commands to simplify our code.
I have currently implemented the following pattern -
public class Command<T extends Data> extends StandardCommand {
private T payload;
public Command(String id, T payload) {
super(id);
this.data = data;
}
}
When I attempt to send an instance of Command along the command gateway (Where T represents the payload object type), the aggregate is not matching the object type to the subscribing class which I have defined within the aggregate. This is resulting in the AggregateNotFound exception being thrown. (The aggregate identifier is specified in the superclass)
Therefore my question is simple, does the CommandGateway object support the subscription of generic message types? If it does, can anyone point me to an example of how this can be achieved please? I wanted to keep this short so I hope I have provided enough detail.
Thanks,
Jordan