MessageFeedbackProcessorClient Class
- java.
lang. Object - com.
microsoft. azure. sdk. iot. service. messaging. MessageFeedbackProcessorClient
- com.
public class MessageFeedbackProcessorClient
A client for handling cloud to device message feedback. For more details on what cloud to device message feedback is, see this document.
This client relies on a persistent amqp/amqp_ws connection to IoT Hub that may break due to network instability. While optional to monitor, users are highly encouraged to utilize the errorProcessorHandler defined in the MessageFeedbackProcessorClientOptions when constructing this client in order to monitor the connection state and to re-open the connection when needed. See the message feedback processor client sample in this repo for best practices for monitoring and handling disconnection events.
Constructor Summary
Method Summary
Modifier and Type | Method and Description |
---|---|
synchronized boolean |
isRunning()
Returns true if this client's underlying amqp connection is currently open and false otherwise. This client may lose connectivity due to network issues, so this value may be false even if you have not closed the client yourself. Monitoring the optional errorProcessor that can be set in MessageFeedbackProcessorClientOptions will provide the context on when connection loss events occur, and why they occurred. |
synchronized void |
start()
Open this client so that it can begin processing message feedback. When you want to stop processing message feedback, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing. |
synchronized void |
start(int timeoutMilliseconds)
Open this client so that it can begin processing message feedback. When you want to stop processing message feedback, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing. |
synchronized void |
stop()
Stops this client from processing any more message feedback and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client is already closed, this function will do nothing. |
synchronized void |
stop(int timeoutMilliseconds)
Stops this client from processing any more message feedback and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client has already been stopped, this function will do nothing. |
Constructor Details
MessageFeedbackProcessorClient
public MessageFeedbackProcessorClient(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol protocol, Function
Construct a MessageFeedbackProcessorClient using a AzureSasCredential instance for authentication.
Parameters:
MessageFeedbackProcessorClient
public MessageFeedbackProcessorClient(String hostName, AzureSasCredential azureSasCredential, IotHubServiceClientProtocol protocol, Function
Construct a MessageFeedbackProcessorClient using a AzureSasCredential instance for authentication.
Parameters:
MessageFeedbackProcessorClient
public MessageFeedbackProcessorClient(String connectionString, IotHubServiceClientProtocol protocol, Function
Construct a MessageFeedbackProcessorClient from the provided connection string.
Parameters:
MessageFeedbackProcessorClient
public MessageFeedbackProcessorClient(String connectionString, IotHubServiceClientProtocol protocol, Function
Construct a MessageFeedbackProcessorClient from the provided connection string.
Parameters:
MessageFeedbackProcessorClient
public MessageFeedbackProcessorClient(String hostName, TokenCredential credential, IotHubServiceClientProtocol protocol, Function
Construct a MessageFeedbackProcessorClient using a TokenCredential instance for authentication.
Parameters:
MessageFeedbackProcessorClient
public MessageFeedbackProcessorClient(String hostName, TokenCredential credential, IotHubServiceClientProtocol protocol, Function
Construct a MessageFeedbackProcessorClient using a TokenCredential instance for authentication.
Parameters:
Method Details
isRunning
public synchronized boolean isRunning()
Returns true if this client's underlying amqp connection is currently open and false otherwise. This client may lose connectivity due to network issues, so this value may be false even if you have not closed the client yourself. Monitoring the optional errorProcessor that can be set in MessageFeedbackProcessorClientOptions will provide the context on when connection loss events occur, and why they occurred.
Returns:
start
public synchronized void start()
Open this client so that it can begin processing message feedback. When you want to stop processing message feedback, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing.
Throws:
start
public synchronized void start(int timeoutMilliseconds)
Open this client so that it can begin processing message feedback. When you want to stop processing message feedback, you should should call stop() to free up network resources. If this client is already started, then this function will do nothing.
Parameters:
Throws:
stop
public synchronized void stop()
Stops this client from processing any more message feedback and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client is already closed, this function will do nothing.
Throws:
stop
public synchronized void stop(int timeoutMilliseconds)
Stops this client from processing any more message feedback and releases all network resources tied to it. Once stopped, this client can be restarted by calling start(). If this client has already been stopped, this function will do nothing.
Parameters:
Throws:
Applies to
Azure SDK for Java