Package org.fcrepo.server.messaging

Examples of org.fcrepo.server.messaging.JMSManager.send()


    public void testVMMessage() throws Exception {
        String topic = "jmsmanager.test";
        properties.setProperty("topic." + topic, topic);
        JMSManager jmsMgr = new JMSManager(properties);
        jmsMgr.listen(topic, this);
        jmsMgr.send(topic, messageText);
        checkMessage(topic, DestinationType.Topic, messageText);
        jmsMgr.close();
    }

    @Ignore("Broker thread in test occationally fails to start")
View Full Code Here


    public void testCreateTopic() throws Exception {
        String topic = "jmsmanager.test";
        JMSManager jmsMgr = new JMSManager(properties);
        jmsMgr.createDestination(topic, DestinationType.Topic);
        jmsMgr.listen(topic, this);
        jmsMgr.send(topic, messageText);
        checkMessage(topic, DestinationType.Topic, messageText);
        jmsMgr.close();
    }

    @Test
View Full Code Here

    public void testCreateQueue() throws Exception {
        String queue = "jmsmanager";
        JMSManager jmsMgr = new JMSManager(properties);
        jmsMgr.createDestination(queue, DestinationType.Queue);
        jmsMgr.listen(queue, this);
        jmsMgr.send(queue, messageText);
        checkMessage(queue, DestinationType.Queue, messageText);
        jmsMgr.close();
    }

    @Test
View Full Code Here

        JMSManager jmsMgr = new JMSManager(properties);
        Destination destination =
            jmsMgr.createDestination(topic, DestinationType.Topic);
        TextMessage textMessage = jmsMgr.createTextMessage(topic, messageText);
        jmsMgr.listen(destination, this);
        jmsMgr.send(destination, textMessage);
        checkMessage(topic, DestinationType.Topic, messageText);
        jmsMgr.close();
    }

    @Test
View Full Code Here

        String messageSelector = "jmsProperty IN ('selectMe')";
        jmsMgr.listen(topic, messageSelector, this);

        TextMessage textMessage = jmsMgr.createTextMessage(topic, messageText);
        textMessage.setStringProperty("jmsProperty", "selectMe");
        jmsMgr.send(topic, textMessage);
        checkMessage(topic, DestinationType.Topic, messageText);

        textMessage = jmsMgr.createTextMessage(topic, messageText);
        textMessage.setStringProperty("jmsProperty", "doNotSelectMe");
        jmsMgr.send(topic, textMessage);
View Full Code Here

        jmsMgr.send(topic, textMessage);
        checkMessage(topic, DestinationType.Topic, messageText);

        textMessage = jmsMgr.createTextMessage(topic, messageText);
        textMessage.setStringProperty("jmsProperty", "doNotSelectMe");
        jmsMgr.send(topic, textMessage);
        checkNoMessage();

        jmsMgr.close();
    }
View Full Code Here

    public void testDurableSubscription() throws Exception {
        // Connect and ensure that a message can be received
        String topic = "jmsmanager.test.durable";
        JMSManager jmsMgr = new JMSManager(properties, "clientId1");
        jmsMgr.listenDurable(topic, this);
        jmsMgr.send(topic, messageText);
        checkMessage(topic, DestinationType.Topic, messageText);

        // Check for listener durability
        String message2 = "Message Number 2";
        jmsMgr.stopDurable(topic);
View Full Code Here

        checkMessage(topic, DestinationType.Topic, messageText);

        // Check for listener durability
        String message2 = "Message Number 2";
        jmsMgr.stopDurable(topic);
        jmsMgr.send(topic, message2);
        checkNoMessage();
        jmsMgr.listenDurable(topic, this);
        checkMessage(topic, DestinationType.Topic, message2);

        // Check unsubscribe
View Full Code Here

        checkMessage(topic, DestinationType.Topic, message2);

        // Check unsubscribe
        String message3 = "Message Number 3";
        jmsMgr.unsubscribeDurable(topic);
        jmsMgr.send(topic, message3);
        checkNoMessage();
        jmsMgr.close();
    }

    @Test
View Full Code Here

        JMSManager jmsMgr = new JMSManager(properties);
        jmsMgr.createDestination(topic, DestinationType.Topic);
        jmsMgr.listen(topic, this);

        TextMessage textMessage = jmsMgr.createTextMessage(topic, messageText);
        jmsMgr.send(topic, textMessage);
        checkMessage(topic, DestinationType.Topic, messageText);

        BytesMessage bytesMessage = jmsMgr.createBytesMessage(topic);
        bytesMessage.writeBytes(messageText.getBytes());
        jmsMgr.send(topic, bytesMessage);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.