Good Practice

From Open Rail Data Wiki
Revision as of 11:43, 26 February 2015 by Leo Inoue (talk | contribs) (Created page with "Please bear in mind the following points when you use the service - they're here to make sure everyone gets a good service: * '''Sign up with one account''' - it gives an acc...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Please bear in mind the following points when you use the service - they're here to make sure everyone gets a good service:

  • Sign up with one account - it gives an accurate reflection of how many people are actually using the service.
  • Connect to the service once - you can receive multiple feeds in a single connection. If you need to access the data more than once, you can do so - but be sensible!
  • Don't leave a failed client running - if you can connect but get an authentication or authorization error - stop your client - don't leave it continually trying.
  • Make sure your client handles failures - if your client fails to connect or is disconnected, use an exponential backoff and wait 1s, 2s, 4s, 8s, 16s etc. before trying to reconnect. Service problems sometimes occur, and if everyone tries to reconnect every second, the service will not recover quickly.
  • Use a durable subscriber - if you want data to be queued in case you disconnect, request a durable subscription when you connect.
  • Use Stomp heartbeats to detect network problems that may otherwise leave your client hanging with no data