Basically you will define a bean for ConnectionFactory, a bean for your Topic, then if you want any of your classes to receive any messages on the Topic you create a <jms:listener-container> inside that you create <jms:listener> where you assign either a MessageListener implementation or you can assign a POJO to be a listener in that configuration.
If you want to send a message to the Topic, then you use the JmsTemplate class to send a message.
Well, personally that is way too much xml for me and I like POJO Listeners, not MessageListeners.
Here is my configuration to have both A and B listen to a Topic. Now the message contains an Order.
And now my two POJO beans A and B will be called when a message is received on the Topic, and say I get a default MessageConverter given to me, so say I have JAXB annotation in my Order that maps to xml that is in the Message, well, Spring will automatically convert the XML to my Order object.