Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

IotHub Receiving messages #39

Closed
mupparajuvamsi opened this issue Oct 4, 2016 · 5 comments
Closed

IotHub Receiving messages #39

mupparajuvamsi opened this issue Oct 4, 2016 · 5 comments
Labels

Comments

@mupparajuvamsi
Copy link

Hi Iam trying to read messages from IotHub using EventHubClient createFromConnectionStringSync
while doing that it is trying to connect to 5671 port and my firewall is blocking that how to specify https port or how to resolve this issue to receive devicetomessages

@aribeironovaes
Copy link
Contributor

Hi @mupparajuvamsi ,

What client are you using to get EventHubClient? Let us know which client you are trying to use on your module and we can try to check if it's possible and how to change port (if possible).

Have you tried to receive the message using our IotHub Client?

Thanks,

Angelo Ribeiro.

@mupparajuvamsi
Copy link
Author

Hi @aribeironovaes
I am using java code to register a device and send a message and receive back the message .First two things are happening fine .But while receiving messages from cloud to device using EventHubClient my Firewall is blocking 5671 port .Moreover i had not seen any documentation regarding receive the message using your IotHub Client in Java API.Could you please be specific about IotHubClient in Java ApI.
If possible can you please send the documentation(link) for Bidirectional communication for IotHub Client
Ex: if i send a message from device to cloud it should receive the message and it should send some response back from cloud to device back .
I saw some where it is mentioned like device endpoints and service endpoints .It is not much clear for java Api(https://azure.microsoft.com/en-in/documentation/articles/iot-hub-devguide-endpoints/)
Send device-to-cloud messages. Receive cloud-to-device messages. Receive device-to-cloud messages. Send cloud-to-device messages and receive delivery acknowledgments. Can i get detailed documentation for all these things with Java Api if possible please guide me where can i get that.

@aribeironovaes
Copy link
Contributor

Thanks @mupparajuvamsi ,

Just to confirm, since it's not clear on your message.
Are you using Java Binding on Azure Gateway SDK to get a message from the cloud? (Cloud to Device?).
Either way, if you want to use java i would suggest you to take a look into here:
https://github.com/Azure/azure-iot-sdks
More specifically here:
https://github.com/Azure/azure-iot-sdks/tree/master/java/device

To check more documentation of the specific scenarios you are listing, take a look into our samples on both Azure Gateway SDK (this github) and Azure IoT Hub.

Once you confirm that you are using Gateway Java Binding to receive the message We can guide you more on the D2C and C2D scenarios, as well as selecting the Java SDK to check if you can change the port used....

Thanks,

Angelo Ribeiro.

@mupparajuvamsi
Copy link
Author

Thanks @aribeironovaes
I am not using Java Binding on Azure Gateway SDK
i am using this for sending and receiving message
https://github.com/Azure/azure-iot-sdks/blob/master/java/device/samples/send-receive-sample/src/main/java/samples/com/microsoft/azure/iothub/SendReceive.java
using this i am able to send while doing that i am getting a iothubstatuscode of OK_EMPTY
while receiving in the setMessageCallBack it is checking com.microsoft.azure.iothub.transport.https.HttpsIotHubConnection public Message receiveMessage()
Here it is checking messageStatus == IotHubStatusCode.OK but when i send i am getting status code OK_EMPTY so that i am not able to receive the message whatever i send .This is the main issue..

Secondly provide any reference documentation for D2C and C2D scenarios, (Sending as well as Receiving )

@aribeironovaes
Copy link
Contributor

Hi @mupparajuvamsi ,

Ok, from your message I can see that you are using https://github.com/Azure/azure-iot-sdks/ instead of gateway sdk.

Can you post your question on https://github.com/Azure/azure-iot-sdks so you can get proper answer? There you will able to have your questions addressed better.

That said, I went to the Azure-iot-sdk and here is the documentation on how you can do C2D and D2C using Java Client:
https://github.com/Azure/azure-iot-sdks/blob/master/java/device/readme.md

Follow the step by step on how to run the sample and you should see both C2D and D2C working there.

They also have an api documentation here: https://azure.github.io/azure-iot-sdks/java/device/api_reference/index.html

Regarding the Firewall issue you are having, please do post a question on https://github.com/Azure/azure-iot-sdks/ and they may be able to help you. If I have to guess you would be able to change protocols that you connect to IoT Hub (Http, Mqtt or AMQP).

I'm going ahead and close this issue here so you can open a proper issue/question on the respective github repository, but feel free to open anytime if you need help with the azure-iot-gateway-sdk.

Thanks a lot and let us know if this helped,

Angelo Ribeiro.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants