Why is there no ReceiveAsync() method on ModuleClient when there is one on DeviceClient? #3486
-
|
I would like to fetch messages from the EdgeHub by pulling instead of implementing message handlers that are triggered. The InnerClient has support for it and the DeviceClient exposes the methods as well but the ModuleClient does not. I need to build an adapter for another framework and it expects to pull the messages using a "read"-method. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
The CompleteAsync() method exists on the client and i assume it should only be used together with ReceiveAsync(), or am i missing something here? |
Beta Was this translation helpful? Give feedback.
-
|
The The module client only supports MQTT or AMQP protocols, and neither of those protocols supports polling to receive a c2d message. The module client still has the Complete/AbandonAsync APIs so that you can positively/negatively acknowledge a c2d message that has been received in the c2d callback handler |
Beta Was this translation helpful? Give feedback.
The
ReceiveAsyncAPI exists solely on the device client because the device client can use HTTP (which can poll for c2d messages).The module client only supports MQTT or AMQP protocols, and neither of those protocols supports polling to receive a c2d message. The module client still has the Complete/AbandonAsync APIs so that you can positively/negatively acknowledge a c2d message that has been received in the c2d callback handler