Skip to content

Instantly share code, notes, and snippets.

View altfatterz's full-sized avatar

Zoltan Altfatter altfatterz

View GitHub Profile
View clone spring-boot-heroku
$ git clone
View deploy to heroku
$ heroku create // automatically adds a git remote named “heroku”
$ git push heroku master
$ heroku logs // check if the application starts up successfully
View Procfile
web: java $JAVA_OPTS -jar target/*.jar
View heroku login
$ heroku login
$ heroku keys:add ~/.ssh/
View app config
server.port: ${port:8080}
View start
$ mvn clean install
$ java -jar target/*.jar // will start on 8080, with --port=<PORT> you can customize
$ curl http://localhost:8080/greeting?name=Zoltan
$ Hello Zoltan
View heroku finished
$ heroku ps:scale web=0 //scale the web dynos down to zero which effectively takes all your app http-processes offline
$ heroku logout
View atmosphere message
public class Message {
private Event event;
private String sessionId;
private long time;
@ManagedService(path = "/event")
public class EventService {
BroadcasterFactory broadcasterFactory = BroadcasterFactory.getDefault();
Broadcaster eventBroadcaster = broadcasterFactory.lookup("/event");
Collection<AtmosphereResource> atmosphereResources = eventBroadcaster.getAtmosphereResources();
for (AtmosphereResource atmosphereResource : atmosphereResources) {
if (message.getSessionId().equals(getSessionId(atmosphereResource))) {
eventBroadcaster.broadcast(message, atmosphereResource);