4

I have an application running on Heroku and I have a messaging system in place. I've used the Faye gem, which has a Faye server to handle live messaging notifications.

How can i get this Faye server to run in production on Heroku?

It has it's own port, and ENV variable.

Please advise.

Sonny Black
  • 1,585
  • 4
  • 23
  • 41
  • 1
    Please try setting it up first, and if it fails, then come back with what you tried and the error. – Vidya Jan 18 '14 at 17:25
  • There is not clear documentation on how to setup Faye on Heroku (on the heroku website). I'm looking for someone to at least point me in the right direction. – Sonny Black Jan 18 '14 at 18:00
  • There is clear [documentation](https://github.com/faye/faye-websocket-ruby) on how to set it up locally. How do you know that isn't sufficient for Heroku? Don't be so scared to try. And if there is an error, we will still be here. Besides, you shouldn't even deploy to Heroku until your application passes all its tests in dev and test environments. That's Software Engineering 101. – Vidya Jan 18 '14 at 18:08
  • Locally yes, and I have it setup and working locally. Heroku is the issue here, the fact that Faye has it's own server has me stuck with how to get it working and running in production on Heroku. – Sonny Black Jan 18 '14 at 18:21
  • In that case, deploy it to Heroku as is. As I already said, if things fail, post your configuration, the error message from the logs, and anything else that is useful. Please see the [guidelines for questions on Stack Overflow](http://stackoverflow.com/questions/how-to-ask). – Vidya Jan 18 '14 at 18:26
  • As another reference point, i set up this repo https://github.com/bunnymatic/faye-server-heroku a while back and am pretty sure it's ready to roll on heroku. Might be worth a look see. – mr rogers Jan 18 '14 at 18:35
  • Mr Rogers, thank you so much. And Vidya, I appreciate you.. The fact is there are no errors it's simply just not working because the Faye server isn't running on Heroku. – Sonny Black Jan 18 '14 at 18:41

1 Answers1

0

You have to run it as a background job if it is its own server.

https://devcenter.heroku.com/articles/background-jobs-queueing

You may be able to start it from a rake task.

https://devcenter.heroku.com/articles/rake

You can run it on a schedule, even once a month if it runs a long time.

https://devcenter.heroku.com/articles/scheduler

Use heroku config to see environment variables. heroku config:set to assign.

Use heroku run bash to get a shell.

You may have to use an additional worker thread from the Heroku dashboard.

Chloe
  • 25,162
  • 40
  • 190
  • 357