Hi,
I’ve implemented a custom CommandCallBack:
import org.axonframework.commandhandling.CommandCallback;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public final class CustomCommandCallback implements CommandCallback {
public static final AxonCallback INSTANCE = new CustomCommandCallback ();
private static final Logger LOGGER = LoggerFactory.getLogger(CustomeKommandCallback .class);
private AxonCallback() {
}
@Override
public void onSuccess(final Object result) {
LOGGER.debug("Command Success: ", result);
…
}
@Override
public void onFailure(final Throwable cause) {
LOGGER.error(“Command failed”, cause);
…
}
}
And registered the CustomCommandCallBack with the GatewayProxyFactory:
…
final GatewayProxyFactory gatewayProxyFactory = new GatewayProxyFactory(commandBus);
gatewayProxyFactory.registerCommandCallback(CustomCommandCallback.INSTANCE);
return gatewayProxyFactory.createGateway(CommandGateway.class);
…
The first implementation was without log4j only with System.out.println works fine.
Problem:
After configuring log4j properly the LoggingCallback has been invoked but my CustomCommanCallback not.
Any Idee?