Package org.activemq.message

Examples of org.activemq.message.ActiveMQTopic


    protected ActiveMQTopic createActiveMQTopicFromQName(QName qName) {
        String localPart = qName.getLocalPart();

        // TODO we should support namespaced topics
        return new ActiveMQTopic(localPart);
    }
View Full Code Here


     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
        System.out.println("Connecting to JMS server.");
        TopicConnection connection = factory.createTopicConnection();
        TopicSession session = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
        connection.start();
        TopicRequestor requestor = new TopicRequestor(session, pubTopic);
View Full Code Here

*/
public class JMSClient {
   
    public static void main(String[] args) throws JMSException {
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        ActiveMQTopic pubTopic = new ActiveMQTopic("demo.org.servicemix.source");
        ActiveMQTopic subTopic = new ActiveMQTopic("demo.org.servicemix.result");
       
        System.out.println("Connecting to JMS server.");
        Connection connection = factory.createConnection();
        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        MessageProducer producer = session.createProducer(pubTopic);
View Full Code Here

    public void testSendNotify() throws Exception {

        ActiveMQNotificationBroker broker = new ActiveMQNotificationBroker();
        ActiveMQConnection connection = broker.getConnection();
        Session session = connection.createSession(false, 0);
        ActiveMQTopic topic = new ActiveMQTopic("Test");
        MessageConsumer consumer = session.createConsumer(topic);

        NotificationMessageHolderType messageHolder = new NotificationMessageHolderType();
        messageHolder.setTopic(topicConverter.toTopicExpression(topic));
        messageHolder.setMessage(createMessage());
View Full Code Here

public class TopicExpressionConverterTest extends TestCase {

    private TopicExpressionConverter topicConverter = new TopicExpressionConverter();

    public void testConvert() {
        ActiveMQTopic topic1 = new ActiveMQTopic("Hello");
        TopicExpressionType type = topicConverter.toTopicExpression(topic1);
        ActiveMQTopic topic2 = topicConverter.toActiveMQTopic(type);
        assertEquals(topic1, topic2);
    }
View Full Code Here

        return createDestination(getClass().getName());
    }

    protected Destination createDestination(String name) {
        if (topic) {
            return new ActiveMQTopic(name);
        }
        else {
            return new ActiveMQQueue(name);
        }
    }
View Full Code Here

            case ActiveMQDestination.ACTIVEMQ_TEMPORARY_TOPIC:
                return new ActiveMQTemporaryTopic(text);

            case ActiveMQDestination.ACTIVEMQ_TOPIC:
                return new ActiveMQTopic(text);

            default:
                throw new IOException("Unknown destination type: " + data);
        }
    }
View Full Code Here

    // Implementation methods
    //-------------------------------------------------------------------------
    protected MessageContainer createContainer(String destinationName) throws JMSException {
        TopicMessageContainer topicMessageContainer =
           new DurableTopicMessageContainer(this, persistenceAdapter.createTopicMessageStore(destinationName), destinationName);
        destinationMap.put(new ActiveMQTopic(destinationName), topicMessageContainer);
        return topicMessageContainer;
    }
View Full Code Here

        destinationMap.put(new ActiveMQTopic(destinationName), topicMessageContainer);
        return topicMessageContainer;
    }

    protected Destination createDestination(String destinationName) {
        return new ActiveMQTopic(destinationName);
    }
View Full Code Here

        assertEquals("queue name", "FOO.BAR", queue.getPhysicalName());

         answer = context.lookup("dynamicTopics/A.B.C");
        assertTrue("Should have found a topic but found: " + answer, answer instanceof ActiveMQTopic);

        ActiveMQTopic topic = (ActiveMQTopic) answer;
        assertEquals("topic name", "A.B.C", topic.getPhysicalName());

    }
View Full Code Here

TOP

Related Classes of org.activemq.message.ActiveMQTopic

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.