You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+147-1Lines changed: 147 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,153 @@ Why Files? See [our diary](http://votesapp.de/10-01-2015/Python_brings_us_back_t
46
46
47
47
We submit the VotesApp stack to the SpringBoot Content only.
48
48
49
-
50
49
# VotesApp Diary
51
50
52
51
To keep Readme clean, we moved the diary to: http://votesapp.de
52
+
53
+
# Highlights
54
+
55
+
This section describes some highlights of our Backend.
56
+
57
+
* Diary
58
+
* Extensibility with Plugins
59
+
* Developer "friendliness"
60
+
*@Value(#":}{}$:"#$@}#$!$), - em how was it?
61
+
* Environment Variables
62
+
* Cough, dude, I need some meds. Really, check my health!
63
+
* Profile Configuration
64
+
* 1, 2, 3, 4, metric
65
+
66
+
## Diary
67
+
From day zero we tried to put our experience during the contest into a diary.
68
+
Today it has more then 10 entries describing the fun we had.
69
+
70
+
## Extensibility with Plugins
71
+
During the contest we had a lot of ideas what else can be done with this.
72
+
Okay, ... the most important [Chuck Norris Plugin](https://github.com/s2team/votesapp/blob/master/src/main/java/de/votesapp/commands/plugins/ChuckNorrisCommandPlugin.java) is done.
73
+
But there are much more, - like the *Rock-paper-scissors*, *Cinema Moves*,
74
+
*Random Cats Videos* (@Kathy, this one is for you <3) or more advanced votings.
Please give [them](https://github.com/fakemongo/fongo) some fame on Github.
147
+
They are doing really great!
148
+
149
+
The `WebClient` is also activated by the same technique.
150
+
There we used the `@Profile("!yowsup")` annotation.
151
+
152
+
Once you configured both, you can active them with `--spring.profiles.active=yowsup,mongo`, or you just don't :).
153
+
154
+
## @Value(#":}{}$:"#$@}#$!$), - em how was it?
155
+
Okay, if you really use it all the day,
156
+
you probably know the syntax (because you understand whats going on).
157
+
But if I work with some Students or ppl. new to Spring, they really create every combination of parentheses,
158
+
dollars, braces and so on.
159
+
160
+
With Spring Boot those @ConfigurationProperties` can be used.
161
+
162
+

163
+
164
+
Just create a counterpart of your configuration structure (yml) and it can be autowirred in your application.
165
+
That is so nice!
166
+
167
+
## Environment Variables
168
+
Our P-System is deployed using docker.
169
+
From there we don't really like to edit property files.
170
+
To get rid of them we use environment variables for the mandatory properties.
171
+
172
+
This makes it also handy to create various Eclipse 8Run Configurations* and an easy deployment.
173
+
174
+

175
+
176
+
## *Cough*, dude, I need some meds. Really, check my health!
177
+
The most critical (and not by AutoConfiguration monitored) Module in VotesApp is the communication to the Yowsup-Rest Server.
178
+
If this services isn't available, VotesApp can't work. Tracking it was really easy with SpringBoot.
179
+
180
+
Since we Poll for new message all day long, we can use this to detect the health.
181
+
182
+
We store exceptions, when they occur in an `Optional` field and anounce them over Springs `HealthIndicator`.
183
+
184
+

185
+
186
+
To see the status, you can check `http://localhost:8080/health`.
187
+
188
+
## Profile Configuration
189
+
We really like the feature to have properties per profile.
190
+
With this we were able to separate the configuration for mongodb, yowsup and our application.
191
+
192
+

193
+
194
+
## 1, 2, 3, 4, metric
195
+
We haven't expand them very much, but there are some metrics about how many messages we processed and how many are answered.
196
+
To do this we used Springs `CounterService` from the [GroupMessageListener](https://github.com/s2team/votesapp/blob/master/src%2Fmain%2Fjava%2Fde%2Fvotesapp%2Fgroups%2FGroupMessageListener.java)
197
+
198
+
As configured by default, they can be checked at `http://localhost:8080/metrics`.
0 commit comments