Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a ClientReconnectingException which is thrown if the client is a…
…ttempting a reconnect while a message should be sent. Prior the sender of a message only got clues about dropped messages due to reconnect in the clients logs, but couldn't handle this case in code. The ClientReconnectingException can be handled by the sender and an optional buffering/ retrying strategy can be implemented. In methods returning a CompletionStage the stage will complete exceptionally conatining the error, in other methods the exception is thrown and has to be catched for custom handling. Co-authored-by: Kalin Kostashki <kalin.kostashki@bosch.io> Signed-off-by: David Schwilk <david.schwilk@bosch.io>
- Loading branch information
1 parent
38c77fd
commit 1f1e1f6
Showing
17 changed files
with
349 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
java/src/main/java/org/eclipse/ditto/client/management/ClientReconnectingException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2022 Contributors to the Eclipse Foundation | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.eclipse.ditto.client.management; | ||
|
||
import javax.annotation.concurrent.Immutable; | ||
|
||
/** | ||
* This exception is thrown in the Ditto client if the client is in a reconnecting state and thus can't send messages | ||
* to the backend. | ||
* | ||
* @since 3.0.0 | ||
*/ | ||
@Immutable | ||
public class ClientReconnectingException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = -4578923424099138760L; | ||
|
||
private static final String MESSAGE = "Message could not be sent, because the client is currently " + | ||
"reconnecting."; | ||
|
||
private ClientReconnectingException() { | ||
super(MESSAGE); | ||
} | ||
|
||
public static ClientReconnectingException newInstance() { | ||
return new ClientReconnectingException(); | ||
} | ||
|
||
} |
Oops, something went wrong.