I’ve looked at the documentation for FutureCallback and it looks pretty straightforward, so I assume I’m missing something.
I’m sending a command and callback to the CommandGateway to update the DeviceAggregate.
In the log messages, deviceFutures.isDone() is true, but null is returned from the deviceFuture.get().
Am I wrong to assume I should be getting the aggregate returned on the future get? It does not throw any axon exceptions.
I have this basic code :
`
FutureCallback deviceFuture = new FutureCallback()
gw.send(deviceCmd, deviceFuture);
DeviceAggregate deviceAgg = null;
try {
log.debug(“device command done? {}”,deviceFuture.isDone());
deviceAgg = deviceFuture.get();
log.debug(“deviceAggId returned : {}”,deviceAgg);
if (deviceAgg == null) {
String error = String.format(“device aggregate enroll failed for deviceId %s”,deviceCmd.getDeviceId());
log.debug(error);
throw new EnrollmentException(error);
}
} catch (ExecutionException e) {
throw new EnrollmentException(String.format(“Enrollment failed with error %s”, e.getMessage()));
} catch (InterruptedException e) {
throw new EnrollmentException(String.format(“Enrollment failed with error %s”, e.getMessage()));
}
`