@Override protected MessageSendingFailedException doBuild(final DittoHeaders dittoHeaders, @Nullable final String message, @Nullable final String description, @Nullable final Throwable cause, @Nullable final URI href) { return new MessageSendingFailedException(dittoHeaders, message, description, cause, href); } }
/** * Constructs a new {@code MessageSendingFailedException} object with the exception message extracted from the given * JSON object. * * @param jsonObject the JSON to read the {@link JsonFields#MESSAGE} field from. * @param dittoHeaders the headers of the command which resulted in this exception. * @return the new MessageSendingFailedException. * @throws org.eclipse.ditto.json.JsonMissingFieldException if the {@code jsonObject} does not have the {@link * JsonFields#MESSAGE} field. */ public static MessageSendingFailedException fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new Builder() .dittoHeaders(dittoHeaders) .message(readMessage(jsonObject)) .description(readDescription(jsonObject).orElse(DEFAULT_DESCRIPTION)) .href(readHRef(jsonObject).orElse(null)) .build(); }
private void handleSendException(final ExternalMessage message, final Exception e, final ActorRef sender) { log.info("Failed to send JMS message: [{}] {}", e.getClass().getSimpleName(), e.getMessage()); final MessageSendingFailedException sendFailedException = MessageSendingFailedException.newBuilder() .cause(e) .dittoHeaders(DittoHeaders.of(message.getHeaders())) .build(); sender.tell(sendFailedException, getSelf()); }
private void handleSendException(final ExternalMessage message, final Exception e, final ActorRef sender) { log.info("Failed to send JMS message: [{}] {}", e.getClass().getSimpleName(), e.getMessage()); final MessageSendingFailedException sendFailedException = MessageSendingFailedException.newBuilder() .cause(e) .dittoHeaders(DittoHeaders.of(message.getHeaders())) .build(); sender.tell(sendFailedException, getSelf()); }
/** * Constructs a new {@code MessageSendingFailedException} object with the exception message extracted from the given * JSON object. * * @param jsonObject the JSON to read the {@link JsonFields#MESSAGE} field from. * @param dittoHeaders the headers of the command which resulted in this exception. * @return the new MessageSendingFailedException. * @throws org.eclipse.ditto.json.JsonMissingFieldException if the {@code jsonObject} does not have the {@link * JsonFields#MESSAGE} field. */ public static MessageSendingFailedException fromJson(final JsonObject jsonObject, final DittoHeaders dittoHeaders) { return new Builder() .dittoHeaders(dittoHeaders) .message(readMessage(jsonObject)) .description(readDescription(jsonObject).orElse(DEFAULT_DESCRIPTION)) .href(readHRef(jsonObject).orElse(null)) .build(); }
} else { log.warning("No producer for destination {} available.", publishTarget); final MessageSendingFailedException sendFailedException = MessageSendingFailedException.newBuilder() .message("Failed to send message, no producer available.") .dittoHeaders(DittoHeaders.of(message.getHeaders()))
@Override protected MessageSendingFailedException doBuild(final DittoHeaders dittoHeaders, @Nullable final String message, @Nullable final String description, @Nullable final Throwable cause, @Nullable final URI href) { return new MessageSendingFailedException(dittoHeaders, message, description, cause, href); } }
} else { log.warning("No producer for destination {} available.", publishTarget); final MessageSendingFailedException sendFailedException = MessageSendingFailedException.newBuilder() .message("Failed to send message, no producer available.") .dittoHeaders(DittoHeaders.of(message.getHeaders()))