Package javax.jms

Examples of javax.jms.Destination


                msgType = JMSConstants.BYTE_MESSAGE_TYPE;
            } else {
                msgType = JMSConstants.BINARY_MESSAGE_TYPE;
            }

            Destination replyTo = getReplyToDestination(jmsTemplate, inMessage);

            if (request.getJMSExpiration() > 0) {
                TimeZone tz = new SimpleTimeZone(0, "GMT");
                Calendar cal = new GregorianCalendar(tz);
                long timeToLive = request.getJMSExpiration() - cal.getTimeInMillis();
View Full Code Here


        String agentName = agent.getName();
        timeout = (timeout < 1) ? _replyTimeout : timeout;
        List<QmfConsoleData> results = Collections.emptyList();
        try
        {
            Destination destination = (replyHandle == null) ? _replyAddress : _asyncReplyAddress;
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(destination);
            request.setJMSCorrelationID(replyHandle);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
View Full Code Here

        }
        String agentName = agent.getName();
        timeout = (timeout < 1) ? _replyTimeout : timeout;
        try
        {
            Destination destination = (replyHandle == null) ? _replyAddress : _asyncReplyAddress;
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(destination);
            request.setJMSCorrelationID(replyHandle);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
View Full Code Here

            String topicBase  = "qmf." + _domain + ".topic";
            _syncSession = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

            // Create a MessageProducer for the QMF topic address used to broadcast requests
            Destination topicAddress = _syncSession.createQueue(topicBase);
            _broadcaster = _syncSession.createProducer(topicAddress);

            // If Asynchronous Behaviour is enabled we create the Queues used to receive async responses
            // Data Indications, QMF Events, Heartbeats etc. from the broker (or other Agents).
            if (!_disableEvents)
            {
                // TODO it should be possible to bind _eventConsumer and _asyncResponder to the same queue
                // if I can figure out the correct AddressString to use, probably not a big deal though.

                _asyncSession = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

                // Set up MessageListener on the Event Address
                Destination eventAddress = _asyncSession.createQueue(topicBase + "/agent.ind.#" + eventAddressOptions);
                _eventConsumer = _asyncSession.createConsumer(eventAddress);
                _eventConsumer.setMessageListener(this);

                // Create the asynchronous JMSReplyTo _replyAddress and MessageConsumer
                _asyncReplyAddress = _asyncSession.createQueue(_address + ".async" + asyncReplyAddressOptions);
                _asyncResponder = _asyncSession.createConsumer(_asyncReplyAddress);
                _asyncResponder.setMessageListener(this);
            }

            // I've extended the synchronized block to include creating the _requester and _responder. I don't believe
            // that this is strictly necessary, but it stops findbugs moaning about inconsistent synchronization
            // so makes sense if only to get that warm and fuzzy feeling of keeping findbugs happy :-)
            synchronized(this)
            {
                // Create a MessageProducer for the QMF direct address, mainly used for request/response
                Destination directAddress = _syncSession.createQueue("qmf." + _domain + ".direct");
                _requester = _syncSession.createProducer(directAddress);

                // Create the JMSReplyTo _replyAddress and MessageConsumer
                _replyAddress = _syncSession.createQueue(_address + syncReplyAddressOptions);
                _responder = _syncSession.createConsumer(_replyAddress);
View Full Code Here

            }
        }

        try
        {
            Destination destination = (replyHandle == null) ? _replyAddress : _asyncReplyAddress;
            MapMessage request = _syncSession.createMapMessage();
            request.setJMSReplyTo(destination);
            request.setJMSCorrelationID(replyHandle);
            request.setStringProperty("x-amqp-0-10.app-id", "qmf2");
            request.setStringProperty("method", "request");
View Full Code Here

            _asyncSession = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            _syncSession = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

            // Create a MessageProducer for the QMF topic address used to broadcast Events & Heartbeats.
            Destination topicAddress = _syncSession.createQueue(topicBase);
            _broadcaster = _syncSession.createProducer(topicAddress);
            _broadcastAddress = "'" + topicBase + "'";

            // Create a MessageProducer for the QMF direct address, mainly used for request/response
            Destination directAddress = _syncSession.createQueue(directBase);
            _responder = _syncSession.createProducer(directAddress);

            // TODO it should be possible to bind _locateConsumer, _mainConsumer and _aliasConsumer to the
            // same queue if I can figure out the correct AddressString to use, probably not a big deal though.

            // Set up MessageListener on the Agent Locate Address
            Destination locateAddress = _asyncSession.createQueue(topicBase + "/console.request.agent_locate");
            _locateConsumer = _asyncSession.createConsumer(locateAddress);
            _locateConsumer.setMessageListener(this);

            // Set up MessageListener on the Agent address
            Destination agentAddress = _asyncSession.createQueue(address);
            _mainConsumer = _asyncSession.createConsumer(agentAddress);
            _mainConsumer.setMessageListener(this);

            // If the product name has been set to qpidd we create an additional consumer address of
            // "qmf.default.direct/broker" in addition to the main address so that Consoles can talk to the
            // broker Agent without needing to do Agent discovery. This is only really needed when the Agent
            // class has been used to create the QmfManagementAgent for the Java broker QmfManagementPlugin.
            // It's important to do this as many tools (such as qpid-config) and demo code tend to use the
            // alias address rather than the discovered address when talking to the broker ManagementAgent.
            if (_product.equals("qpidd"))
            {
                String alias = directBase + "/broker";
                _log.info("Creating address {} as an alias address for the broker Agent", alias);
                Destination aliasAddress = _asyncSession.createQueue(alias);
                _aliasConsumer = _asyncSession.createConsumer(aliasAddress);
                _aliasConsumer.setMessageListener(this);
            }

            _connection.start();
View Full Code Here

                msgType = JMSConstants.BYTE_MESSAGE_TYPE;
            } else {
                msgType = JMSConstants.BINARY_MESSAGE_TYPE;
            }

            Destination replyTo = getReplyToDestination(jmsTemplate, inMessage);

            if (request.getJMSExpiration() > 0) {
                TimeZone tz = new SimpleTimeZone(0, "GMT");
                Calendar cal = new GregorianCalendar(tz);
                long timeToLive = request.getJMSExpiration() - cal.getTimeInMillis();
View Full Code Here

        boolean durableSub = isDurSubTest();

        //declare the test queue
        Connection consumerConnection = getConnection();
        Session consumerSession = consumerConnection.createSession(false,Session.AUTO_ACKNOWLEDGE);
        Destination destination = getDestination(consumerSession, durableSub);
        if(durableSub)
        {
            consumerSession.createDurableSubscriber((Topic)destination, getName()).close();
        }
        else
View Full Code Here

        final boolean transacted = deliveryMode == Session.SESSION_TRANSACTED ? true : false;
        final Session clientSession = clientConnection.createSession(transacted, deliveryMode);

        MessageConsumer consumer;
        Destination dest = getDestination(clientSession, durableSub);
        AMQQueue checkQueue;
        if(durableSub)
        {
            consumer = clientSession.createDurableSubscriber((Topic)dest, getName());
            checkQueue = new AMQQueue("amq.topic", "clientid" + ":" + getName());
View Full Code Here

        Message message = consumer.receive(10000);

        assertNotNull("Message should not be null", message);

        Destination destination = message.getJMSDestination();

        assertNotNull("JMSDestination should not be null", destination);

        assertEquals("Incorrect Destination type", queue.getClass(), destination.getClass());
    }
View Full Code Here

TOP

Related Classes of javax.jms.Destination

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.