java - Scaling Spring on Heroku -


i wondering if point me tutorial or blog post on writing spring application can run in single process integration testing locally when deployed deploy different subsystems different processes/dynos on heroku.

for example, have services user management, job processing, etc. in web application. want run web application locally. when deploy heroku want deploy stateless web front end 2 dynos , have worker dynos can select different services run on. may decide group 2 of these services 1 process or decide each should run in own process. when services run in own process need transparently add kind of transport rest or rabbitmq or akka or such.

any pointers on start looking learn how this? or thinking incorrectly , you'd suggest different approach? need figure out how setup application , how construct maven , intellij achieve this.

thanks.

i can't point prefabricated article or post, can share direction started down solve similar problem. essentially, proposed approach similar yours - put specific services potentially long-running logic in worker dynos , pass messages via jesque (java port of resque) on redistogo instance (heroku add-on). never got separate web vs. worker spring contexts ironed out (moved on other priorities) gist of 1) web tier app context configured post messages , 2) worker app context configured consume.

that said, used foreman locally simulate heroku environment debug scaling (foreman start --formation="web=2" + apache mod_proxy_http). big spring gotcha when scale 2+ dynos - make sure using redis or memcache session storage when using webapp-runner. spring uses httpsession default store security context... no session affinity or native tomcat session replication.

final caveat - in our case, none of our worker processing needed reflected end user. said, using pusher other features (also heroku add-on). if need update user when async task completes, recommend looking @ it.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -