Package javax.jms

Examples of javax.jms.Session.createTopic()


        if (started.compareAndSet(false, true)) {
            LOGGER.debug(broker.getContainer().getName() + ": Starting jms flow");
            super.start();
            try {
                Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                Topic broadcastTopic = broadcastSession.createTopic(broadcastDestinationName);
                broadcastConsumer = broadcastSession.createConsumer(broadcastTopic, null, true);
                broadcastConsumer.setMessageListener(new MessageListener() {
                    public void onMessage(Message message) {
                        try {
                            Object obj = ((ObjectMessage) message).getObject();
View Full Code Here


            LOGGER.debug(broker.getContainer().getName() + ": broadcasting info for " + event);
        }
        Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        try {
            ObjectMessage msg = broadcastSession.createObjectMessage(event);
            Topic broadcastTopic = broadcastSession.createTopic(broadcastDestinationName);
            MessageProducer topicProducer = broadcastSession.createProducer(broadcastTopic);
            topicProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            topicProducer.send(msg);
        } finally {
            broadcastSession.close();
View Full Code Here

            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            if (destination == null) {
                if (STYLE_QUEUE.equals(endpoint.getDestinationStyle())) {
                    destination = session.createQueue(endpoint.getJmsProviderDestinationName());
                } else {
                    destination = session.createTopic(endpoint.getJmsProviderDestinationName());
                }
            }
            MessageProducer producer = session.createProducer(destination);

            NormalizedMessage nm = exchange.getMessage("in");
View Full Code Here

        Connection conn = getConnection("test", "client", "guest");
        Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
        conn.start();

        // create kipper
        Topic kipper = sess.createTopic("kipper");
        TopicSubscriber subscriber = sess.createDurableSubscriber(kipper, "kipper");

        subscriber.close();
        sess.unsubscribe("kipper");
View Full Code Here

        Connection conn = getConnection("test", "client", "guest");
        Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
        conn.start();

        // create kipper
        Topic kipper = sess.createTopic("kipper");
        TopicSubscriber subscriber = sess.createDurableSubscriber(kipper, "kipper");

        subscriber.close();
        try
        {
View Full Code Here

        Connection conn = getConnection("test", "client", "guest");
        Session sess = conn.createSession(true, Session.SESSION_TRANSACTED);
        conn.start();

        // create kipper
        Topic kipper = sess.createTopic("kipper");
        TopicSubscriber subscriber = sess.createDurableSubscriber(kipper, "kipper");

        subscriber.close();
        sess.unsubscribe("kipper");
View Full Code Here

        Connection connection = connectionFactory.createConnection();
        connection.start();

        Session session = connection.createSession(false,
                Session.AUTO_ACKNOWLEDGE);
        Destination destination = session.createTopic(TOPIC_NAME);
        MessageConsumer consumer = session.createConsumer(destination);

        // wait till you get atleast one message
        MapMessage m;
        for (m = null; m == null;) {
View Full Code Here

        }
    }

    public void startConsumerMonitor() throws JMSException {
        Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        Topic broadcastTopic = broadcastSession.createTopic(getBroadcastDestinationName());
        Topic advisoryTopic = AdvisorySupport.getConsumerAdvisoryTopic((ActiveMQDestination) broadcastTopic);
        monitorMessageConsumer = broadcastSession.createConsumer(advisoryTopic);
        monitorMessageConsumer.setMessageListener(new MessageListener() {
            public void onMessage(Message message) {
                onConsumerMonitorMessage(message);
View Full Code Here

        if (started.compareAndSet(false, true)) {
            log.debug(broker.getContainer().getName() + ": Starting jms flow");
            super.start();
            try {
                Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                Topic broadcastTopic = broadcastSession.createTopic(broadcastDestinationName);
                broadcastConsumer = broadcastSession.createConsumer(broadcastTopic, null, true);
                broadcastConsumer.setMessageListener(new MessageListener() {
                    public void onMessage(Message message) {
                        try {
                            Object obj = ((ObjectMessage) message).getObject();
View Full Code Here

            log.debug(broker.getContainer().getName() + ": broadcasting info for " + event);
        }
        Session broadcastSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        try {
            ObjectMessage msg = broadcastSession.createObjectMessage(event);
            Topic broadcastTopic = broadcastSession.createTopic(broadcastDestinationName);
            MessageProducer topicProducer = broadcastSession.createProducer(broadcastTopic);
            topicProducer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            topicProducer.send(msg);
        } finally {
            broadcastSession.close();
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.