bluedot.net

June 25, 2010

Using Notifo push notifications to tell you when java breaks down

Filed under:Development, Java, Technology — sps @ 4:22 pm

notifo logo
If you haven’t heard of it, you should check it out: http://notifo.com/

It took me about 60 seconds to create an account, download the iphone app and send myself a test message. They have android and blackberry clients in the works as well.

The API is straight forward and is easily callable via curl.

I have a project I am working on that is currently relying on some buggy libraries (don’t ask) which cause the JVM to periodically exhaust it’s memory. I can alert myself when this happens using notifo simply by starting the JVM with

-XX:OnOutOfMemoryError="notifo.sh failure 'stupid thing failed again'"
flag. here is the official docs on that flag:

-XX:OnOutOfMemoryError="<cmd args>;<cmd args>"
Run user-defined commands when an OutOfMemoryError is first thrown. 
(Introduced in 1.4.2 update 12, 6)

here is the simple shell script i am using:

#!/bin/sh
curl -k -u ${USERNAME}:${APIKEY} \
-d "to=${USERNAME}&msg='$2'&title='$1'" \

https://api.notifo.com/v1/send_notification

This is an extremely trivial example, but you can probably see the potential for sending yourself notifications easily.

update: check out my notifo java client and notifo log4j appender

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Blue Dot
  • StumbleUpon
  • Technorati
  • Reddit
  • YahooMyWeb
end

No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

Protected by WP-Hashcash.