Closed mainTAP closed 6 years ago
Hi @mainTAP ,
The push channel solution to listen to events is more or less deprecated and is just left in Bambou for backward compatibility (but might be removed in the next year). The reason for this is that push channel uses HTTP Long poll, which has some flaws including the risk of causing memory issues if used improperly (luckily, bambou does it right, but still... it is not safe).
The preferred way of working with events is using JMS or AMQP. Both are supported in 5.1.1 and above. JMS has been supported for a long time (all 4.0 releases and above).
An example JMS client: https://github.com/nuagenetworks/jmsclient An example AMQP client (in python): https://github.com/nuagenetworks/AMQP-Client
On the issue you are facing: It could be that this has to do with API token that expires after a time, requiring a new session to be setup. The quick solution would be to capture the exception and the error itself, and re-initiate the push channel connection.
Hope this helps.
Hi @pdellaert ,
Thank you very much for pointing me to the JMS/AMQP route, these would certainly be much better option than the HTTP long poll. Is there anything necessary to do at the VSD to enable JMS ? I was trying to follow the VSP API Programming Guide ( set the iptables / ipset at the VSD node and create the client user in VSD Architect ) but unfortunately the example JMS client is still unable to connect . Many thanks.
Hi @mainTAP,
JMS is enabled by default on all VSDs in 4.0 and 5.x releases. JMS and AMQP is enabled by default on VSDs of release 5.1.1 and above.
You could try as a test and open up full IPtables by default and see if that helps. Make sure you use the right ports.
In all my tests, i've never had to open up ports myself, i think. Not sure if i had to add my client IP to the ipset, don't think so, but could be wrong.
Cheers
Dear team,
I've been experiencing several connection errors when using the Bambou PushCenter to listen to VSD Events after a random period of time. The connection is made to the nuageX VSD environment and re-runing the script connects and listens to events fine for some time again until another connection error occurs.
For instance :
or
or
Sometimes I only receive the error without the exception and the push_center continues to listening to the events ( this however repeats in a loop and doesn't attempt to re-connect to the VSD until the script is re-run ) :
The testing code is very simple, just runs the push_center and listen to the received events :
Can you please advise what would be the best way to handle these errors so that the push_center attempts to re-connect and continues listening to the events ?
Thank you very much.