Package org.activemq.message

Examples of org.activemq.message.ActiveMQQueue


    public void testCreateQueue() throws JMSException {
       
        // The broker should start with zero destinations.
        BrokerAdmin brokerAdmin = getBrokerAdmin();
        brokerAdmin.createMessageContainer(new ActiveMQQueue(TEST_QUEUE_NAME)  );
       
        MessageContainerAdmin[] admins = brokerAdmin.listMessageContainerAdmin();
        assertEquals(1, admins.length);
       
        assertEquals(admins[0].getDestinationName(), TEST_QUEUE_NAME);       
View Full Code Here


   
    public void testDeleteQueue() throws JMSException {
       
        // The broker should start with zero destinations.
        BrokerAdmin brokerAdmin = getBrokerAdmin();
        brokerAdmin.createMessageContainer(new ActiveMQQueue(TEST_QUEUE_NAME)  );
        brokerAdmin.destoryMessageContainer(new ActiveMQQueue(TEST_QUEUE_NAME)  );
       
        MessageContainerAdmin[] admins = brokerAdmin.listMessageContainerAdmin();
        assertEquals(0, admins.length);
    }
View Full Code Here

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

        return getClass().getName() + "." + getName();
    }
   
    protected ActiveMQMessage createMessage() {
        ActiveMQMessage msg = new ActiveMQMessage();
        msg.setJMSDestination(new ActiveMQQueue(getDestination()));
        msg.setMemoryUsage(MESSAGE_SIZE);
        msg.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT);
        return msg;
    }
View Full Code Here

            }
        };

        ActiveMQActivationSpec activationSpec = endpointActivationKey.getActivationSpec();
        if ("javax.jms.Queue".equals(activationSpec.getDestinationType())) {
            dest = new ActiveMQQueue(activationSpec.getDestination());
        } else if ("javax.jms.Topic".equals(activationSpec.getDestinationType())) {
            dest = new ActiveMQTopic(activationSpec.getDestination());
        } else {
            throw new ResourceException("Unknown destination type: " + activationSpec.getDestinationType());
        }
View Full Code Here

        String subject = getClass().getName();
        if (isTopic) {
            return new ActiveMQTopic(subject);
        }
        else {
            return new ActiveMQQueue(subject);
        }
    }
View Full Code Here

        if( isEmpty(destinationType) || isEmpty(destination) )
            return null;
       
        ActiveMQDestination dest = null;
        if (Queue.class.getName().equals(destinationType)) {
            dest = new ActiveMQQueue(destination);
        } else if (Topic.class.getName().equals(destinationType)) {
            dest = new ActiveMQTopic(destination);
        } else {
            assert false : "Execution should never reach here";
        }
View Full Code Here

     * @throws JMSException if the session fails to create a queue due to some internal error.
     * @since 1.1
     */
    public Queue createQueue(String queueName) throws JMSException {
        checkClosed();
        return new ActiveMQQueue(queueName);
    }
View Full Code Here

        initializeMessage(msg1);

        for (int i = 0; i < Short.MAX_VALUE; i++) {
            msg1.setProducerKey("Prod:" + i);
            msg1.setTransactionId("Transaction:"+i);
            msg1.setJMSDestination(new ActiveMQQueue("queue."+i));
            msg1.setJMSReplyTo(new ActiveMQQueue("replyto."+i));

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DataOutputStream dos = new DataOutputStream(baos);
            wf.setTransportDataOut(dos);
            wf.writePacket(msg1, dos);
View Full Code Here

    /**
     * Factory method to create new Queue instances
     */
    protected Queue createQueue(String name) {
        return new ActiveMQQueue(name);
    }
View Full Code Here

TOP

Related Classes of org.activemq.message.ActiveMQQueue

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.