-
Notifications
You must be signed in to change notification settings - Fork 26
Push Notifications
The ability to receive push notifications will require configuring three endpoints (Google Cloud Messaging, AeroGear Unified Push Server and Hawkular) and hosting two of them (obviously not the Google one).
AeroGear has a great guide — read until the section “Your first Android Push App”. You will need AeroGear Unified Push Server installed. The easiest way is to use OpenShift — AeroGear has a great guide again.
You will need to remember two pairs of credentials. On the picture you can see three lines on the top and three lines on the bottom. The top ones are ones you will use to configure Hawkular, the bottom ones are for Hawkular Android Client. Google Cloud Messaging credentials will be useful as well.
- Build Alerts and deploy the AeroGear plugin.
$ cp hawkular-actions-plugins/hawkular-actions-aerogear/target/hawkular-actions-aerogear.war ${HAWKULAR}/modules/org/hawkular/nest/main/deployments
- Open the Hawkular configuration file.
$ vim standalone/configuration/standalone.xml
- Find the
system-propertiesblock and add following lines replacing placeholders with AeroGear credentials from the first section.
<property name="org.hawkular.actions.aerogear.root.server.url" value="AEROGEAR_SERVER_URL"/>
<property name="org.hawkular.actions.aerogear.application.id" value="AEROGEAR_VARIANT_ID"/>
<property name="org.hawkular.actions.aerogear.master.secret" value="AEROGEAR_SECRET"/>- Run the Hawkular instance.
$ sh bin/standalone.sh
- Check if the plugin is registered, it should show up as some
INFOmessages. - Create any trigger using web UI — for example for email sending.
- Check that the AeroGear plugin is in place.
$ http --auth USER:PASS GET :8080/hawkular/alerts/plugins
- Create the AeroGear action.
$ http --auth USER:PASS POST :8080/hawkular/alerts/actions "actionPlugin"="aerogear" "actionId"="ups" -v
- Attach the action to the created trigger.
$ http --auth USER:PASS GET :8080/hawkular/alerts/triggers
$ http --auth USER:PASS PUT :8080/hawkular/alerts/triggers/TRIGGER "actions":='{"aerogear":["ups"], "email":["mail@mail.com"]}'
Create a file named server.properties at the root of the project with following contents replacing placeholders with AeroGear credentials from the first section.
ups.url = AEROGEAR_URL
ups.variant = AEROGEAR_VARIANT
ups.secret = AEROGEAR_SECRET
gcm.sender = GOOGLE_SENDER