Intel® Edge Software Hub
Get answers from community peers to your questions about building Edge Software Hub solutions for edge compute node.
Announcements
Welcome to the Intel Community! If you like the answer to your question, please mark it as 'Accepted Solution' to help others.

The Edge Software Vision Package for Red Hat Enterprise Linux is now available here.

Learn more about developing on Intel® Hardware and Software here.
396 Discussions

EII subcriber rev function doesnt work

Amagaquian
Beginner
861 Views

In documentation it says that the recv function allows a wait parameter to be entered (apparently in milliseconds) but the recv ignores the parameter and hangs waiting for a new message.

Labels (1)
0 Kudos
1 Solution
JesusE_Intel
Moderator
616 Views

Hi Amagaquian,

 

I would like to apologize for the extended delay from our side.

 

I just tested the Publish/Subscribe Tutorial in Open Edge Insights (OEI) 3.0 and was able to set the timeout amount and catch the exception by wrapping msg = subscriber.recv(timeout=10000) in a try-block as follows.

 

 

try:
    msg = subscriber.recv(timeout=10000)
except Exception:
    print("Publisher Disconnected…")
    continue

 

 

By doing this, the subscriber will wait 10 seconds after the publisher disconnects. It will continue to print "Publisher Disconnected" every 10 seconds until the publisher is running again. One the publisher is running the subscriber will start receiving messages.

 

Hope this helps.

 

Regards,

Jesus

 

View solution in original post

0 Kudos
5 Replies
JesusE_Intel
Moderator
833 Views

Hi Amagaquian,


Looking at the message bus api documentation for Python, the recv() function does take two optional parameters (blocking, timeout). Could you please share which version of EII you are using? Are you using EII from Edge Software Hub or Open Edge Insights?


Also, are you running one of our message bus samples to test or are you using your own application?


Regards,

Jesus



0 Kudos
Amagaquian
Beginner
824 Views

Hi Jesus,

The documentation say that the function need only one parameter (https://open-edge-insights.github.io/IEdgeInsights/common/libs/EIIMessageBus/python/docs/publish_subscribe_tutorial.html?highlight=recv) and I configured in this way:

msg = subscriber.recv( timeout = 3000)

Well, now I have a Timeout exception but I don't know how I can capture this exception eii.exc.Timeout Exception.

0 Kudos
JesusE_Intel
Moderator
761 Views

Hi Amagaquian,


I apologize for the delay on our side, I have escalated this issue to my peers for additional input. I will let you know what I find out.


Regards,

Jesus


0 Kudos
JesusE_Intel
Moderator
617 Views

Hi Amagaquian,

 

I would like to apologize for the extended delay from our side.

 

I just tested the Publish/Subscribe Tutorial in Open Edge Insights (OEI) 3.0 and was able to set the timeout amount and catch the exception by wrapping msg = subscriber.recv(timeout=10000) in a try-block as follows.

 

 

try:
    msg = subscriber.recv(timeout=10000)
except Exception:
    print("Publisher Disconnected…")
    continue

 

 

By doing this, the subscriber will wait 10 seconds after the publisher disconnects. It will continue to print "Publisher Disconnected" every 10 seconds until the publisher is running again. One the publisher is running the subscriber will start receiving messages.

 

Hope this helps.

 

Regards,

Jesus

 

0 Kudos
JesusE_Intel
Moderator
588 Views

If you need any additional information, please submit a new question as this thread will no longer be monitored.


0 Kudos
Reply