@Test public void testTemporaryDestinationTypes() throws Exception { JmsEndpoint endpoint = getMandatoryEndpoint("activemq:test.queue", JmsEndpoint.class); JmsConfiguration configuration = endpoint.getConfiguration(); JmsProviderMetadata providerMetadata = configuration.getProviderMetadata(); assertNotNull("provider", providerMetadata); Class<? extends TemporaryQueue> queueType = endpoint.getTemporaryQueueType(); Class<? extends TemporaryTopic> topicType = endpoint.getTemporaryTopicType(); log.info("Found queue type: " + queueType); log.info("Found topic type: " + topicType); assertNotNull("queueType", queueType); assertNotNull("topicType", topicType); assertEquals("queueType", ActiveMQTempQueue.class, queueType); assertEquals("topicType", ActiveMQTempTopic.class, topicType); }
@Override protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { BrokerConfiguration brokerConfiguration = new BrokerConfiguration(); setProperties(brokerConfiguration, parameters); byte destinationType = ActiveMQDestination.QUEUE_TYPE; if (remaining.startsWith(JmsConfiguration.QUEUE_PREFIX)) { remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.QUEUE_PREFIX.length()), '/'); } else if (remaining.startsWith(JmsConfiguration.TOPIC_PREFIX)) { destinationType = ActiveMQDestination.TOPIC_TYPE; remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TOPIC_PREFIX.length()), '/'); } else if (remaining.startsWith(JmsConfiguration.TEMP_QUEUE_PREFIX)) { destinationType = ActiveMQDestination.TEMP_QUEUE_TYPE; remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TEMP_QUEUE_PREFIX.length()), '/'); } else if (remaining.startsWith(JmsConfiguration.TEMP_TOPIC_PREFIX)) { destinationType = ActiveMQDestination.TEMP_TOPIC_TYPE; remaining = removeStartingCharacters(remaining.substring(JmsConfiguration.TEMP_TOPIC_PREFIX.length()), '/'); } ActiveMQDestination destination = ActiveMQDestination.createDestination(remaining, destinationType); BrokerEndpoint brokerEndpoint = new BrokerEndpoint(uri, this, destination, brokerConfiguration); return brokerEndpoint; }
public static ActiveMQComponent newAMQInstance(){ ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(); connectionFactory.setBrokerURL("vm:localhost"); // use a pooled connection factory between the module and the queue PooledConnectionFactory pooledConnectionFactory = new PooledConnectionFactory(connectionFactory); // how many connections should there be in the session pool? pooledConnectionFactory.setMaxConnections(100); pooledConnectionFactory.setMaximumActiveSessionPerConnection(100); pooledConnectionFactory.setCreateConnectionOnStartup(true); pooledConnectionFactory.setBlockIfSessionPoolIsFull(false); JmsConfiguration jmsConfiguration = new JmsConfiguration(pooledConnectionFactory); jmsConfiguration.setDeliveryPersistent(false); jmsConfiguration.setTimeToLive(1000*10); ActiveMQComponent activeMQComponent = ActiveMQComponent.activeMQComponent("vm:localhost"); return activeMQComponent; }
@Override public void setConfiguration(JmsConfiguration configuration) { if (configuration instanceof K8ActiveMQConfiguration) { ((K8ActiveMQConfiguration) configuration).setActiveMQComponent(this); } super.setConfiguration(configuration); }
@Override protected JmsConfiguration createConfiguration() { K8ActiveMQConfiguration answer = new K8ActiveMQConfiguration(); answer.setBrokerURL("tcp://"+answer.getServiceName() + ":" + answer.getPort()); answer.setActiveMQComponent(this); return answer; }
@Override public void setConfiguration(JmsConfiguration configuration) { if (configuration instanceof ActiveMQConfiguration) { ((ActiveMQConfiguration) configuration).setActiveMQComponent(this); } super.setConfiguration(configuration); }
public JmsConfiguration getConfiguration() { return configuration; }
public void setConfiguration(JmsConfiguration configuration) { this.configuration = configuration; }
public AMQPComponent(JmsConfiguration configuration) { super(configuration); }
@Override protected JmsConfiguration createConfiguration() { ActiveMQConfiguration answer = new ActiveMQConfiguration(); answer.setActiveMQComponent(this); return answer; }
public ActiveMQComponent(CamelContext camelContext, ConnectionFactory connectionFactory) { super(camelContext); setConfiguration(new JmsConfiguration(connectionFactory)); }