@Override public Receive createReceive() { return ReceiveBuilder.create() .match(RetrieveConnectionStatusResponse.class, command -> log.debug("Retrieved connection status response for connection {} with status: {}", command.getConnectionId(), command.getConnectionStatus())) .match(ConnectionNotAccessibleException.class, exception -> log.debug("Received ConnectionNotAccessibleException for connection {} " + "(most likely, the connection was deleted): {}", exception.getDittoHeaders().getCorrelationId().orElse("<unknown>"), exception.getMessage())) .match(DittoRuntimeException.class, exception -> log.debug("Received {} for connection {} : {}", exception.getClass().getSimpleName(), exception.getDittoHeaders().getCorrelationId().orElse("<unknown>"), exception.getMessage())) .matchEquals(ReconnectMessages.START_RECONNECT, msg -> handleStartReconnect()) .matchEquals(ReconnectMessages.END_RECONNECT, msg -> handleEndReconnect()) .matchAny(m -> { log.warning("Unknown message: {}", m); unhandled(m); }).build(); }
@Override public Receive createReceive() { return ReceiveBuilder.create() .match(RetrieveConnectionStatusResponse.class, command -> log.debug("Retrieved connection status response for connection {} with status: {}", command.getConnectionId(), command.getConnectionStatus())) .match(ConnectionNotAccessibleException.class, exception -> log.debug("Received ConnectionNotAccessibleException for connection {} " + "(most likely, the connection was deleted): {}", exception.getDittoHeaders().getCorrelationId().orElse("<unknown>"), exception.getMessage())) .match(DittoRuntimeException.class, exception -> log.debug("Received {} for connection {} : {}", exception.getClass().getSimpleName(), exception.getDittoHeaders().getCorrelationId().orElse("<unknown>"), exception.getMessage())) .matchEquals(ReconnectMessages.START_RECONNECT, msg -> handleStartReconnect()) .matchEquals(ReconnectMessages.END_RECONNECT, msg -> handleEndReconnect()) .matchAny(m -> { log.warning("Unknown message: {}", m); unhandled(m); }).build(); }