iotedge: IoT Edge - AMQP messages are not received, and error in sending the messages

I’m trying to send/receive messages to/from another iot edge module.

Following is the code:

var amqpSetting = new AmqpTransportSettings(TransportType.Amqp_Tcp_Only); ITransportSettings[] settings = { amqpSetting };

// Open a connection to the Edge runtime this.IoTHubModuleClient = await ModuleClient.CreateFromEnvironmentAsync(settings);

await this.IoTHubModuleClient.OpenAsync();

For receive:

await this.IoTHubModuleClient.SetInputMessageHandlerAsync(“mainInput”, this.ReceiveMessage, this.IoTHubModuleClient);

For send:

await moduleClient.SendEventAsync(“mainOutput”, upstreamMessage); ReceiveMessage is not being invoked even though the other module is sending the message, and I get following exception after some time for SendEventAsync

Microsoft.Azure.Devices.Client.Exceptions.IotHubCommunicationException: The operation did not complete within the allocated time 00:01:00 for object message. —> Microsoft.Azure.Devices.Client.Exceptions.IotH ubCommunicationException: The operation did not complete within the allocated time 00:01:00 for object message. —> System.TimeoutException: The operation did not complete within the allocate d time 00:01:00 for object message. at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result) at Microsoft.Azure.Amqp.SendingAmqpLink.EndSendMessage(IAsyncResult result) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) — End of stack trace from previous location where exception was thrown — at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTSendingLink.SendAmqpMessageAsync(AmqpMessage amqpMessage, TimeSpan timeout) — End of inner exception stack trace — — End of inner exception stack trace — at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTSendingLink.SendAmqpMessageAsync(AmqpMessage amqpMessage, TimeSpan timeout) at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpIoTSendingLink.SendMessageAsync(Message message, TimeSpan timeout) at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.SendMessageAsync(Message message, TimeSpan timeout) at Microsoft.Azure.Devices.Client.Transport.AmqpIoT.AmqpUnit.SendEventAsync(Message message, TimeSpan timeout) at Microsoft.Azure.Devices.Client.Transport.Amqp.AmqpTransportHandler.SendEventAsync(Message message, CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.<>c__DisplayClass22_0.<<ExecuteWithErrorHandlingAsync>b__0>d.MoveNext() — End of stack trace from previous location where exception was thrown — at Microsoft.Azure.Devices.Client.Transport.ErrorDelegatingHandler.ExecuteWithErrorHandlingAsync[T](Func1 asyncOperation) at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.<>c__DisplayClass14_0.<<SendEventAsync>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.Azure.Devices.Client.Transport.RetryDelegatingHandler.SendEventAsync(Message message, CancellationToken cancellationToken) at Microsoft.Azure.Devices.Client.InternalClient.SendEventAsync(String outputName, Message message) at xxxx1.SendMessage(String messageContent, String correlationId, String messageType, String messageVersion, Object userContext )

But this message is being received in the other IoT edge module.

Can someone help me with this?

Thanks.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (4 by maintainers)

Most upvoted comments

@asergaz hmm yes. But tried on real edge device with win10 1809 as well. Its the same result. –Keshava

@asergaz oops. I missed that post. Sorry.

Here’s the info: Host OS: Win10 Arch : amd64 Windows containers

Will update the other informations in sometime… Thanks.

Hello @keshava-hm,

This may be off-base, but is your message handler returning MessageResponse.Completed when its done?

yes, it does.