public String getQueueName() throws JMSException { return getPhysicalName(); }
protected String getQueueUri(ActiveMQQueue queue) { return "activemq:" + queue.getPhysicalName(); }
protected String getQueueUri(ActiveMQQueue queue) { return "activemq:" + queue.getPhysicalName(); }
protected String getQueueUri(ActiveMQQueue queue) { return "cmq:" + queue.getPhysicalName(); }
public String getQueueName() throws JMSException { return getPhysicalName(); }
public String getQueueName() throws JMSException { return getPhysicalName(); }
public String getQueueName() throws JMSException { return getPhysicalName(); }
public String getQueueName() throws JMSException { return getPhysicalName(); }
private void restoreDurableQueue(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length()); StringTokenizer tokenizer = new StringTokenizer(name); tokenizer.nextToken(":."); String qosString = tokenizer.nextToken(); tokenizer.nextToken(); String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1)); QoS qoS = QoS.valueOf(qosString); LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(queue); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH); if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); doSubscribe(consumerInfo, topicName, qoS); // mark this durable subscription as restored by Broker restoredQueues.add(queue); } } catch (IOException e) { LOG.warn("Could not restore the MQTT queue subscriptions.", e); } }
private void restoreDurableQueue(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length()); StringTokenizer tokenizer = new StringTokenizer(name); tokenizer.nextToken(":."); String qosString = tokenizer.nextToken(); tokenizer.nextToken(); String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1)); QoS qoS = QoS.valueOf(qosString); LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(queue); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH); if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); doSubscribe(consumerInfo, topicName, qoS); // mark this durable subscription as restored by Broker restoredQueues.add(queue); } } catch (IOException e) { LOG.warn("Could not restore the MQTT queue subscriptions.", e); } }
private void restoreDurableQueue(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { String name = queue.getPhysicalName().substring(VIRTUALTOPIC_CONSUMER_PREFIX.length()); StringTokenizer tokenizer = new StringTokenizer(name); tokenizer.nextToken(":."); String qosString = tokenizer.nextToken(); tokenizer.nextToken(); String topicName = convertActiveMQToMQTT(tokenizer.nextToken("").substring(1)); QoS qoS = QoS.valueOf(qosString); LOG.trace("Restoring queue subscription: {}:{}", topicName, qoS); ConsumerInfo consumerInfo = new ConsumerInfo(getNextConsumerId()); consumerInfo.setDestination(queue); consumerInfo.setPrefetchSize(ActiveMQPrefetchPolicy.DEFAULT_QUEUE_PREFETCH); if (protocol.getActiveMQSubscriptionPrefetch() > 0) { consumerInfo.setPrefetchSize(protocol.getActiveMQSubscriptionPrefetch()); } consumerInfo.setRetroactive(true); consumerInfo.setDispatchAsync(true); doSubscribe(consumerInfo, topicName, qoS); // mark this durable subscription as restored by Broker restoredQueues.add(queue); } } catch (IOException e) { LOG.warn("Could not restore the MQTT queue subscriptions.", e); } }
private void deleteDurableQueues(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { LOG.debug("Removing queue subscription for {} ",queue.getPhysicalName()); DestinationInfo removeAction = new DestinationInfo(); removeAction.setConnectionId(protocol.getConnectionId()); removeAction.setDestination(queue); removeAction.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); protocol.sendToActiveMQ(removeAction, new ResponseHandler() { @Override public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException { // ignore failures.. } }); } } catch (Throwable e) { LOG.warn("Could not delete the MQTT queue subscriptions.", e); } }
private void deleteDurableQueues(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { LOG.debug("Removing queue subscription for {} ",queue.getPhysicalName()); DestinationInfo removeAction = new DestinationInfo(); removeAction.setConnectionId(protocol.getConnectionId()); removeAction.setDestination(queue); removeAction.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); protocol.sendToActiveMQ(removeAction, new ResponseHandler() { @Override public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException { // ignore failures.. } }); } } catch (Throwable e) { LOG.warn("Could not delete the MQTT queue subscriptions.", e); } }
private void deleteDurableQueues(List<ActiveMQQueue> queues) { try { for (ActiveMQQueue queue : queues) { LOG.debug("Removing queue subscription for {} ",queue.getPhysicalName()); DestinationInfo removeAction = new DestinationInfo(); removeAction.setConnectionId(protocol.getConnectionId()); removeAction.setDestination(queue); removeAction.setOperationType(DestinationInfo.REMOVE_OPERATION_TYPE); protocol.sendToActiveMQ(removeAction, new ResponseHandler() { @Override public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException { // ignore failures.. } }); } } catch (Throwable e) { LOG.warn("Could not delete the MQTT queue subscriptions.", e); } }
protected void addQueue(ActiveMQQueue queue) throws Exception { String queueUri = getQueueUri(queue); ActiveMQComponent jmsComponent = getComponent(); Endpoint endpoint = new JmsQueueEndpoint(queueUri, jmsComponent, queue.getPhysicalName(), jmsComponent.getConfiguration()); camelContext.addEndpoint(queueUri, endpoint); }
protected void addQueue(ActiveMQQueue queue) throws Exception { String queueUri = getQueueUri(queue); ActiveMQComponent jmsComponent = getComponent(); Endpoint endpoint = new JmsQueueEndpoint(queueUri, jmsComponent, queue.getPhysicalName(), jmsComponent.getConfiguration()); camelContext.addEndpoint(queueUri, endpoint); }
protected void executeListQueues(final CommandLine cmdLine) throws JMSException { if (conn instanceof org.apache.activemq.ActiveMQConnection) { final org.apache.activemq.ActiveMQConnection amqConn = (org.apache.activemq.ActiveMQConnection) conn; final Set<ActiveMQQueue> queues = amqConn.getDestinationSource() .getQueues(); final Set<ActiveMQTopic> topics = amqConn.getDestinationSource() .getTopics(); if (!queues.isEmpty()) { output("Queues:"); for (ActiveMQQueue q : queues) { output(q.getPhysicalName()); } } if (!topics.isEmpty()) { output("Topics:"); for (ActiveMQTopic t : topics) { output(t.getTopicName()); } } } else { throw new RuntimeException( "Only ActiveMQ 5.x connections support listing queues"); } }