Azure / azure-event-hubs-c

C client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
Other
7 stars 18 forks source link

AzureEventHubs proxy support with amqp websockets #50

Open TreesaChandy opened 5 years ago

TreesaChandy commented 5 years ago

Does Azure Eventhubs library support Amqp through websockets?If yes, how do we configure that?I need to find some information how to send the event hub messages through a proxy?

TreesaChandy commented 5 years ago

Can someone please reply to this since I need to know whether its possible or not?

dcristoloveanu commented 5 years ago

Hi @TreesaChandy,

Sorry for the delay.

Short answer is: it is not supported out of the box.

Long answer: Currently EH client for C does not have the config support to do WebSockets connections. The underlying uamqp library (https://github.com/Azure/azure-uamqp-c) does have that support and for example the IoTHub C SDK client which uses the same infrastructure does support WebSockets. A simple sample of uamqp connecting with WS is here: https://github.com/Azure/azure-uamqp-c/tree/master/samples/websockets_sample.

But probably that's of little use for you as I understand you'd like the C EH client to be configurable to use WebSockets.

This would be a new feature to be added to the EH C SDK. Is it a big feature? Probably not, but here is what would need to happen:

IoTHub client (https://github.com/Azure/azure-iot-sdk-c) and EH SDK for C are VERY much similar, so there is prior art on doing this.

Unfortunately I do not have the bandwidth to add this feature at the moment. One option would be to PR it yourself if you feel comfortable with adding it.

HTH, /Dan

TreesaChandy commented 5 years ago

Thanks for the reply . Let me know whenever you implement this. One more question regarding AzureIOTHub sdk since I am using that to send messages from cloud to device. With the IOTHub I tried using mqtt over websockets and its losing connection to the proxy in between and getting a segfault. But without proxy its working fine.

I am using below line of code to enable proxy with MQTT over websockets if ( IoTHubClient_SetOption(iotHubClientHandle , OPTION_HTTP_PROXY, &http_proxy_options) != IOTHUB_CLIENT_OK) do you have any idea about this?

dcristoloveanu commented 5 years ago

@TreesaChandy

The segfault in IoTHub client sounds like a clear bug to me. I am unsure in which layer the bug is (IoTHub client, uamqp, C shared), but I'd say since this is starting with the IoTHubClient API, can you open an issue in the IoTHub SDK for C repo?

https://github.com/Azure/azure-iot-sdk-c

Usually the IOTHub team will first look at this repo, if issues are open in the repos for the other layers it might take longer until they get to it.

Let me know how it goes!

/Dan

Benjamin118 commented 4 years ago

Hi,

We exactly have the same problem (using eventHub with network with proxy).

Our releases shall work with proxy or not. For the moment, we can't execute our tests on network with proxy configuration, which is prohibitive.

I agree with the proposed feature. We need some visibility about when you can fix it and for which SDK release.

Thank you in advance