header parallax image
uncoditional

code liberated

  • Home
  • Pete
  • Home
  • Pete
AWSColdFusionJavaLanguagesSNS

AWS SNS using JDK – code sample

September 28, 2017Peter Lombardo7029 views

As with many programming blog posts, this one is the product of an inordinate amount of time trying to dig up pieces of a puzzle, which one would have thought to be straight forward.

This example is written for ColdFusion, but as you can see, the meat can be done using Java directly and maybe other languages as well.

First off, we need an AWS SNS “topic”  which might otherwise be called a modern listserve on steroids.  It supports email, sns and other input/output interfaces.  Setting one up is fairly straightforward, so I won’t bother with much here.

As of this writing, the AWS Java SDK is up to 1.11.203 and changing almost every day (see here for full listing on GH).  Our organization (and this code) is currently using 1.11.132 however, available here from AWS via GitHub. NOTE: the zip file does not have the *.java files which are required for the next steps so use the *tar.jz!

A few points about the AWS JDK:

  1. In the online JDK javaDocs, despite the fact that the frame navigation for amazonSNSClient is listed, it is basically completely depracated and replaced by AmazonSNSClientBuilder.  See here for why this is, and why its better.
  2. I’m not a java person, but I found it very frustrating trying to find javadocs on this version.  AFIK there were none!  Every link i found ultimatley lead me to “latest” folder.   So my solution was to extract the whole jar file, use the command line to step into that folder and run the following code:
    find . -type f -name "*.java" | xargs javadoc -Xdoclint:none -d outputdir 

    But even that didn’t work! Javadoc threw all kinds of errors and only generated part of the outptu. So, ultimately I left with just browsing into the sns folder itself and running that command.  The result can be found here:  aws-java-sdk-1.11.132-SNS-javadocs.

So, here’s the code.  More lines than the older “client” api required, but we’re told it’s better.

https://gist.github.com/obxpete/341785005f3fb885d4732a3a90bcebab

Props to Simon Hooker’s post for helping me get started.

 

  • tweet
previous story

Infromation Architecture: a must-do waaaay before a new application is built

next story

cf – create crud from column names.sql

Peter Lombardo

Peter Lombardo

Web developer too long.

you might also like

Angular component code block execution order

March 31, 2022

AWS CloudSearch file/data upload using JDK – code sample

November 2, 2017

programming basics/refresher done right

October 31, 2017

Leave a Response Cancel reply

You must be logged in to post a comment.

about me

uncoditional

Pete Lombardo

I like people and coding. Both change. Twenty years of full-stack development. I live in Maryland.

Recent Posts

  •   lives on!
    									
  • Cannot find module ‘…/…’ or its corresponding type declarations.
  • *ngIf – use parentheses
  • Angular component code block execution order
  • material dialog- how to get response data .subscribe()

Recent Comments

    Archives

    • June 2022
    • March 2022
    • June 2020
    • June 2019
    • November 2017
    • October 2017
    • September 2017
    • August 2017
    • June 2017
    • June 2015
    • May 2015
    • April 2015
    • October 2014
    • September 2014
    • July 2014
    • June 2014
    • May 2013
    • February 2013
    • January 2013
    • November 2012
    • October 2012

    Categories

    • angular
    • AWS
    • before the code
    • Browser Support
    • CFML & Mach-II
    • Chromebook
    • ckEditor
    • CloudSearch
    • ColdFusion
    • Java
    • javascript/typescript
    • JQuery and CSS
    • Languages
    • Life
    • material design
    • project
    • Projects
    • SNS
    • SQL
    • Tools
    • Uncategorized
    • unCODitional

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org
    0
    Followers
    0
    Followers
    0
    Followers
    0
    Followers

    Follow @ Instagram

    Configuration error or no pictures...