In the application that we build for our customer, there is a requirement to be able to consume messages from several JMS Topic and Queue, process the message, and then forward it to Amazon SNS Topic. To anticipate additional JMS topic / queue, we build a generic Java message processor, where for each queue/topic we could easily plug-in a different message processor for a different data source, like the diagram below.

Java message processor

THe message processor must be generic enough and it could be extended for a different message processor, depending on the processing logic for each data source. 

So we design a Java-based message processor application using Strategy design pattern, where we can easily add additional message processor class and configure it in the property file. With this design pattern, we remove code duplication of the consuming part, and forwarding to Amazon SNS topic.