* @throws javax.jms.JMSException
*/
public void sendMessage(BrokerClient client, ActiveMQMessage message) throws JMSException {
ActiveMQDestination dest = (ActiveMQDestination) message.getJMSDestination();
if (dest != null && dest.isTopic() && message.getJMSDeliveryMode() == DeliveryMode.PERSISTENT) {
MessageContainer container = getContainer(message.getJMSDestination().toString());
Set matchingSubscriptions = subscriptionContainer.getSubscriptions(message.getJMSActiveMQDestination());
// note that we still need to persist the message even if there are no matching
// subscribers as they may come along later
// plus we don't pre-load subscription information
container.addMessage(message);
if (!matchingSubscriptions.isEmpty()) {
for (Iterator i = matchingSubscriptions.iterator();i.hasNext();) {
Subscription sub = (Subscription) i.next();
if (sub.isTarget(message)) {
sub.addMessage(container, message);