Saturday, January 24, 2015

Slack Java Webhook

GoCD recently added support for notification extension point. I've started building slack notification plugin (its a WIP here). As part of that I wrote a Java client for Slack Webhooks. Although I found a java library here, which said it was published but I couldn't find it anywhere on sonatype / maven central. I can't even publish it, so I took that as an inspiration and wrote my own implementation on


new Slack(webhookUrl)
    .icon(":smiling_imp:") // Ref -
    .push(new SlackMessage("Text from my ").bold("Slack-Java-Client"));

It gets posted in the slack channel like below


For Maven,
For SBT,
libraryDependencies += "in.ashwanthkumar" % "slack-java-webhook" % "0.0.3"

Java Utils Library

After a long time I seem to be writing Java code more often recently. A bunch GoCD plugins, code kata sessions with friends and things like that. I saw there are few things like List transformations, filter, I automatically start searching for Option / Some and None implementations. Simple solutions would be just write it in Scala, right? I know, but there are places where I wasn't. Example was GoCD plugins. Reasons being - Scala standard library is heavy and usually causes OOM on Agent without increasing heap sizes and final jar is also heavy in terms of size.

Check out If you find some implementations not so efficient or can be done better, please do let me know.



  • Lists#map
  • Lists#filter
  • Lists#foldL
  • Lists#find
  • Lists#isEmpty
  • Lists#nonEmpty
  • Lists#mkString


  • Sets#copy
  • Sets#isEmpty
  • Sets#nonEmpty


  • Iterables#exists
  • Iterables#forall


  • Option / Some / None
  • Tuple2 / Tuple3
  • Function
  • Predicate


For Maven,
For SBT,
libraryDependencies += "in.ashwanthkumar" % "my-java-utils" % "0.0.2"