activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Bertram <>
Subject Re: EmbeddedJMS doesn't register JMS topics or queues
Date Fri, 16 Sep 2016 20:12:37 GMT
Either use JNDI (see numerous examples shipped with Artemis) or don't use a lookup at all (i.e.
just instantiate the destination programmatically).


----- Original Message -----
From: "mcacker" <>
Sent: Friday, September 16, 2016 1:18:07 PM
Subject: EmbeddedJMS doesn't register JMS topics or queues


I'm in the process of migrating from HornetQ to Artemis and have run into an
issue with EmbeddedJMS.  After processing the configuration file, i'm
expecting the MapBindingRegistry (i'm not using JNDI) to have references to
the configured queues and topics, like it did in HornetQ, but the registry
is empty.

Stepping through the code, that step is now performed if the queue
configuration has a binding specified (from JMSServerManagerImpl):

   protected boolean internalCreateJMSQueue(final boolean storeConfig,
                                            final String queueName,
                                            final String selectorString,
                                            final boolean durable,
                                            final boolean autoCreated,
                                            final String... bindings) throws
Exception {

      if (active && queues.get(queueName) != null) {
         return false;

      runAfterActive(new WrappedRunnable() {
         public String toString() {
            return "createQueue for " + queueName;

         public void runException() throws Exception {

            if (internalCreateQueue(queueName, selectorString, durable,
autoCreated)) {

               ActiveMQDestination destination = queues.get(queueName);
               if (destination == null) {
                  // sanity check. internalCreateQueue should already have
done this check
                  throw new IllegalArgumentException("Queue does not

               String[] usedBindings = null;

*               if (bindings != null) {
                  ArrayList<String> bindingsToAdd = new ArrayList<>();

                  for (String bindingsItem : bindings) {
                     if (bindToBindings(bindingsItem, destination)) {

                  usedBindings = bindingsToAdd.toArray(new
                  addToBindings(queueBindings, queueName, usedBindings);
               if (storeConfig && durable) {
PersistedDestination(PersistedType.Queue, queueName, selectorString,
                  if (usedBindings != null) {
                     storage.addBindings(PersistedType.Queue, queueName,

but looking at the configuration parser, there is no way of specifying such
a binding, the element isn't supported:

   public static JMSQueueConfiguration parseQueueConfiguration(final Node
node) throws Exception {
      Element e = (Element) node;
      NamedNodeMap atts = node.getAttributes();
      String queueName = atts.getNamedItem(NAME_ATTR).getNodeValue();
      String selectorString = null;
      boolean durable = XMLConfigurationUtil.getBoolean(e, "durable",
      NodeList children = node.getChildNodes();
      for (int i = 0; i < children.getLength(); i++) {
         Node child = children.item(i);

(QUEUE_SELECTOR_NODE_NAME.equals(children.item(i).getNodeName())) {
            Node selectorNode = children.item(i);
            Node attNode =
            selectorString = attNode.getNodeValue();

      return newQueue(queueName, selectorString, durable);

How should this now be done?

thanks, Mitchell

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message