Package org.apache.activemq.command

Examples of org.apache.activemq.command.ActiveMQTempTopic


    protected ActiveMQTempDestination createTempDestination(boolean topic) throws JMSException {

        // Check if Destination info is of temporary type.
        ActiveMQTempDestination dest;
        if (topic) {
            dest = new ActiveMQTempTopic(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId());
        } else {
            dest = new ActiveMQTempQueue(info.getConnectionId(), tempDestinationIdGenerator.getNextSequenceId());
        }

        DestinationInfo info = new DestinationInfo();
View Full Code Here


        case TOPIC:
            return new ActiveMQTopic(name);
        case TEMP_QUEUE:
            return new ActiveMQTempQueue(name);
        case TEMP_TOPIC:
            return new ActiveMQTempTopic(name);
        default:   
            throw new IllegalArgumentException("Not in the valid destination format");
        }
    }
View Full Code Here

  }

  public ActiveMQDestination createTempTopic(String name) {
        ActiveMQDestination rc = tempDestinations.get(name);
        if( rc == null ) {
            rc = new ActiveMQTempTopic(connectionId, tempDestinationGenerator.getNextSequenceId());
            sendToActiveMQ(new DestinationInfo(connectionId, DestinationInfo.ADD_OPERATION_TYPE, rc), null);
            tempDestinations.put(name, rc);
            tempDestinationAmqToStompMap.put(rc.getQualifiedName(), name);
        }       
        return rc;
View Full Code Here

        case TOPIC:
            return new ActiveMQTopic(name);
        case TEMP_QUEUE:
            return new ActiveMQTempQueue(name);
        case TEMP_TOPIC:
            return new ActiveMQTempTopic(name);
        default:   
            throw new IllegalArgumentException("Not in the valid destination format");
        }
    }
View Full Code Here

        super.setUp();
    }

    @Override
    protected void isValidDestination(Object header) {
        ActiveMQTempTopic destination = assertIsInstanceOf(ActiveMQTempTopic.class, header);
        LOG.info("Received message has a temporary topic: " + destination);
    }
View Full Code Here

            ActiveMQConnectionFactory brokerAFactory = new ActiveMQConnectionFactory(item.broker.getTransportConnectorByScheme("tcp").getName()
                    + "?jms.watchTopicAdvisories=false");
            Connection connection = brokerAFactory.createConnection();
            connection.start();
            connection.createSession(false, Session.AUTO_ACKNOWLEDGE).createConsumer(
                    AdvisorySupport.getNoTopicConsumersAdvisoryTopic(new ActiveMQTempTopic(">"))).setMessageListener(new MessageListener() {
                @Override
                public void onMessage(Message message) {
                    sendsWithNoConsumers.incrementAndGet();
                }
            });
View Full Code Here

        defaultEntry.setSendAdvisoryIfNoConsumers(true);
        DeadLetterStrategy deadletterStrategy = new SharedDeadLetterStrategy();
        deadletterStrategy.setProcessNonPersistent(true);
        defaultEntry.setDeadLetterStrategy(deadletterStrategy);
        defaultEntry.setDispatchPolicy(new PriorityDispatchPolicy());
        map.put(new ActiveMQTempTopic(">"), defaultEntry);

        for (BrokerItem item : brokers.values()) {
            item.broker.setDestinationPolicy(map);
        }
    }
View Full Code Here

        super.setUp();
    }

    @Override
    protected void isValidDestination(Object header) {
        ActiveMQTempTopic destination = assertIsInstanceOf(ActiveMQTempTopic.class, header);
        LOG.info("Received message has a temporary topic: " + destination);
    }
View Full Code Here

    public ActiveMQDestination createTempDestination(String name, boolean topic) {
        ActiveMQDestination rc = tempDestinations.get(name);
        if( rc == null ) {
            if (topic) {
                rc = new ActiveMQTempTopic(connectionId, tempDestinationGenerator.getNextSequenceId());
            } else {
                rc = new ActiveMQTempQueue(connectionId, tempDestinationGenerator.getNextSequenceId());
            }
            sendToActiveMQ(new DestinationInfo(connectionId, DestinationInfo.ADD_OPERATION_TYPE, rc), null);
            tempDestinations.put(name, rc);
View Full Code Here

    public void testTransformDestination() throws Exception {
        assertTrue("Transforming a TempQueue destination to an ActiveMQTempQueue",
                   ActiveMQMessageTransformation.transformDestination((TemporaryQueue)new ActiveMQTempQueue()) instanceof ActiveMQTempQueue);

        assertTrue("Transforming a TempTopic destination to an ActiveMQTempTopic",
                   ActiveMQMessageTransformation.transformDestination((TemporaryTopic)new ActiveMQTempTopic()) instanceof ActiveMQTempTopic);

        assertTrue("Transforming a Queue destination to an ActiveMQQueue", ActiveMQMessageTransformation.transformDestination((Queue)new ActiveMQQueue()) instanceof ActiveMQQueue);

        assertTrue("Transforming a Topic destination to an ActiveMQTopic", ActiveMQMessageTransformation.transformDestination((Topic)new ActiveMQTopic()) instanceof ActiveMQTopic);
View Full Code Here

TOP

Related Classes of org.apache.activemq.command.ActiveMQTempTopic

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.