protected Destination lookupDestination(Session session) throws Exception { if (protocol.equals("AMQP")) { return session.createQueue(destination); } else { return ActiveMQDestination.createDestination(this.destination, ActiveMQDestination.TYPE.QUEUE); } }
protected Destination lookupDestination(Session session) throws Exception { if (protocol.equals("AMQP")) { return session.createQueue(destination); } else { return ActiveMQDestination.createDestination(this.destination, ActiveMQDestination.TYPE.QUEUE); } }
public void pushMessage(String destinationName, Message message) { if (destinationName == null) { throw new IllegalArgumentException("sendMessage failure - destination name is required"); } else if (message == null) { throw new IllegalArgumentException("sendMessage failure - a Message is required"); } ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TYPE.QUEUE); getInternalClient().pushMessage(destination, message); }
public void pushMessage(String destinationName, Message message) { if (destinationName == null) { throw new IllegalArgumentException("sendMessage failure - destination name is required"); } else if (message == null) { throw new IllegalArgumentException("sendMessage failure - a Message is required"); } ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TYPE.QUEUE); getInternalClient().pushMessage(destination, message); }
ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TYPE.QUEUE); if (destination.isQueue()) { Queue queue = getDestinationQueue(destinationName);
/** * Get the Queues corresponding to a JMS Topic. * <p> * The full name of the JMS Topic including the prefix should be provided - i.e. topic://myTopic. If the destination type prefix * is not included in the destination name, a prefix of "topic://" is assumed. * * @param topicName the full name of the JMS Destination * @return the number of messages in the JMS Destination */ public List<Queue> getTopicQueues(String topicName) { List<Queue> queues = new LinkedList<>(); ActiveMQDestination destination = ActiveMQDestination.createDestination(topicName, ActiveMQDestination.TYPE.TOPIC); if (!destination.isQueue()) { BindingQueryResult bindingQueryResult = null; try { bindingQueryResult = jmsServer.getActiveMQServer().bindingQuery(destination.getSimpleAddress()); } catch (Exception ex) { log.error(String.format("getTopicQueues( %s ) - bindingQuery for %s failed", topicName, destination.getAddress()), ex); return queues; } if (bindingQueryResult.isExists()) { ActiveMQServer activeMQServer = jmsServer.getActiveMQServer(); for (SimpleString queueName : bindingQueryResult.getQueueNames()) { queues.add(activeMQServer.locateQueue(queueName)); } } } return queues; }
/** * Get the Queues corresponding to a JMS Topic. * <p> * The full name of the JMS Topic including the prefix should be provided - i.e. topic://myTopic. If the destination type prefix * is not included in the destination name, a prefix of "topic://" is assumed. * * @param topicName the full name of the JMS Destination * @return the number of messages in the JMS Destination */ public List<Queue> getTopicQueues(String topicName) { List<Queue> queues = new LinkedList<>(); ActiveMQDestination destination = ActiveMQDestination.createDestination(topicName, ActiveMQDestination.TYPE.TOPIC); if (!destination.isQueue()) { BindingQueryResult bindingQueryResult = null; try { bindingQueryResult = jmsServer.getActiveMQServer().bindingQuery(destination.getSimpleAddress()); } catch (Exception ex) { log.error(String.format("getTopicQueues( %s ) - bindingQuery for %s failed", topicName, destination.getAddress()), ex); return queues; } if (bindingQueryResult.isExists()) { ActiveMQServer activeMQServer = jmsServer.getActiveMQServer(); for (SimpleString queueName : bindingQueryResult.getQueueNames()) { queues.add(activeMQServer.locateQueue(queueName)); } } } return queues; }
ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TYPE.QUEUE); if (destination.isQueue()) { Queue queue = getDestinationQueue(destinationName);
ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TYPE.QUEUE); String address = destination.getAddress(); String name = destination.getName();
ActiveMQDestination destination = ActiveMQDestination.createDestination(destinationName, ActiveMQDestination.TYPE.QUEUE); String address = destination.getAddress(); String name = destination.getName();