@Override protected MessageTimeoutException doBuild(final DittoHeaders dittoHeaders, @Nullable final String message, @Nullable final String description, @Nullable final Throwable cause, @Nullable final URI href) { return new MessageTimeoutException(dittoHeaders, message, description, cause, href); }
/** * Deserialize from a JSON object. * * @param jsonObject the JSON object to deserialize. * @param dittoHeaders the headers. * @return an instance of this class. * @throws NullPointerException if any argument is {@code null}. */ public static MessageTimeoutException fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new Builder() .loadJson(jsonObject) .dittoHeaders(dittoHeaders) .message(readMessage(jsonObject)) .description(readDescription(jsonObject).orElse(DEFAULT_DESCRIPTION)) .href(readHRef(jsonObject).orElse(null)) .build(); }
private void handleReceiveTimeout(final ReceiveTimeout receiveTimeout) { if (messageTimeout != null && !isFireAndForgetMessage) { logger.info("Got ReceiveTimeout when a message response was expected after timeout {}", messageTimeout); handleDittoRuntimeException(new MessageTimeoutException(messageTimeout.getSeconds())); } else { logger.warning("No response within server request timeout ({}), shutting actor down.", serverRequestTimeout); // note that we do not need to send a response here, this is handled by RequestTimeoutHandlingDirective stop(); } }