Command to export data ?

DDD wise a request to export data is a command.

In Axon Commands are related to Aggregates, Is this always the case?

If I want to Export a data (Projection data)
Would you suggest to use commandGateway in the following way? or Am I sidetracking my logic somewhere?

-----my code is something like this

public void doExport(){
commandGateway.send(new ExportProjectjonToFtpCommand (…))


public handle(ExportProjectjonToFtpCommand command) {


public execute(){
data = queryGateway.query(Projection)


------any thoughts are welcome

Hi Sven,

I do not see anything wrong with that. You get to use Axon Server routing/broker mechanism for free. Your handler (job) component is decoupled from the REST adapter and you could deploy it independently (as a separate app) in the future if you like.

This post is explaining a similar case, with more details on how you can use @RoutingKey (together with the external command handlers) to gain more control:!topic/axonframework/UGe0mjUMcrA