Closed raghavan20 closed 4 years ago
Hi @raghavan20,
Thanks for reporting the issue. I will try to reproduce it and come back to you.
@raghavan20 - I have tested this scenario with a module running the C# SDK and Abandoned messages will be re-queued and resent to the module by the EdgeHub as expected. I will try with the Node.js sdk and get back to you.
Also note that the retry policy you are using only affects the _client _side__ behavior. So, for example, it will kick in when the client is sending messages and the sending fails. It does not affect the server side behavior. The EdgeHub uses an exponential backoff policy, which is currently not configurable.
Thanks for your help and clarifying on retry policy. I use Python SDK for developing custom module.
Hi @raghavan20, It looks like there is a bug with MQTT that the message is resent from edgehub but it is not received by the module. AMQP works, can you use AMQP from your module as a workaround?
Hi @ancaantochi. I can try AMQP
; can you point me to a code sample that can consume messages with appropriate queue / route declarations?
I tried to switch just the protocol in my custom module and I got few errors and looks like I have to change some other bits of code / configuration.
Code
def __init__(self, protocol=IoTHubTransportProvider.AMQP):
self.client_protocol = protocol
self.client = IoTHubModuleClient()
self.client.create_from_environment(protocol)
Error
Error: Time:Tue Mar 5 06:00:50 2019 File:/usr/sdk/src/c/iothub_client/src/iothubtransportamqp.c Func:IotHubTransportAMQP_Subscribe_InputQueue Line:163 AMQP does not support input queues
Error: Time:Tue Mar 5 06:00:50 2019 File:/usr/sdk/src/c/iothub_client/src/iothub_client_core_ll.c Func:IoTHubClientCore_LL_SetInputMessageCallbackImpl Line:2819 IoTHubTransport_Subscribe_InputQueue failed
Unexpected error IoTHubClient.set_input_message_callback, IoTHubClientResult.ERROR from IoTHub
At this time, unfortunately, the only option is for you to wait for the IoT Hub C SDK to gain support for AMQP on Edge. This work has been scheduled but I don't have dates for you yet.
Okay. Is the bug with MQTT requeueing to be fixed sometime soon?
With MQTT message disposition isn't supported at all. This feature is supported only on AMQP and AMQP support is not available in the C SDK as of now which the Python SDK relies upon. We don't have a good story at this time unfortunately.
cc @tameraw @massand
Closing the issue for now, please feel free to reopen if necessary.
Since I encountered the same problem trying to implement a transactional consumer with the C SDK. I need to use the C SDK since I'm enforced to use other libraries that are only available for C - and I need at-least-once semantic of message processing; so what are my options? As far as I get it the problem with not redelivering abandoned messages using MQTT still persists - and trying to use AMQP raises errors even trying to connect to the local edge hub. cc @avranju @lt72
I have an Edge device that runs two custom modules a
publisher
and aconsumer
. Apublisher
is a simulator module that continuously produces messages. Theconsumer
module receives messages from publisher module through edgeHub routing and it POSTs to a third-party API. A test is made to ensure when messages could not be sent to third-party API, the messages are queued so that the same message can be retried without loss.I have been talking with some tech people from IoTHub Docs team and I have tried various changes which I will elaborate and also include logs.
Below code demonstrates two points
Edge Hub config that sets longer TTL
Logs highlighting that messages are not retried when messages could not be processed and even after they are marked ABANDONED
Context (Environment)
Device (Host) Operating System
Architecture
amd64
Container Operating System
Docker on Ubuntu
Runtime Versions
iotedged
iotedge 1.0.6.1 (3fa6cbef8b7fc3c55a49a622735eb1021b8a5963)
Edge Agent
mcr.microsoft.com/azureiotedge-agent 1.0
Edge Hub
mcr.microsoft.com/azureiotedge-hub 1.0
Docker
server: 18.06.1-ce