protected EndpointReferenceType addSubscription(ActiveMQNotificationBroker broker) throws Exception {
// START SNIPPET: subscribe
String topicName = TOPIC_NAME;
TopicExpressionType topicExpression = new TopicExpressionType();
topicExpression.getContent().add(topicName);
EndpointReferenceType consumerReference = createReference();
Boolean useNotify = Boolean.TRUE;
QueryExpressionType precondition = null;
QueryExpressionType selector = null;
Object subscriptionPolicy = null;
XMLGregorianCalendar terminationTime = null;
EndpointReferenceType reference = broker.subscribe(consumerReference, topicExpression, useNotify, precondition,
selector, subscriptionPolicy, terminationTime);
// END SNIPPET: subscribe
return reference;
}