Пример #1
0
    private void run() {
      try {
        if (HornetQLogger.LOGGER.isDebugEnabled()) {
          HornetQLogger.LOGGER.debug("deleting temporary queue " + bindingName);
        }
        if (postOffice.getBinding(bindingName) != null) {
          postOffice.removeBinding(bindingName);
        }

        queue.deleteAllReferences();
      } catch (Exception e) {
        HornetQLogger.LOGGER.errorRemovingTempQueue(e, bindingName);
      }
    }
Пример #2
0
  private void doSend(final ServerMessage msg, final boolean direct) throws Exception {
    // check the user has write access to this address.
    try {
      securityStore.check(msg.getAddress(), CheckType.SEND, this);
    } catch (HornetQException e) {
      if (!autoCommitSends) {
        tx.markAsRollbackOnly(e);
      }
      throw e;
    }

    if (tx == null || autoCommitSends) {
    } else {
      routingContext.setTransaction(tx);
    }

    postOffice.route(msg, routingContext, direct);

    Pair<UUID, AtomicLong> value = targetAddressInfos.get(msg.getAddress());

    if (value == null) {
      targetAddressInfos.put(
          msg.getAddress(), new Pair<UUID, AtomicLong>(msg.getUserID(), new AtomicLong(1)));
    } else {
      value.setA(msg.getUserID());
      value.getB().incrementAndGet();
    }

    routingContext.clear();
  }
Пример #3
0
  public void route(final ServerMessage message, final RoutingContext context) throws Exception {
    // We must make a copy of the message, otherwise things like returning credits to the page won't
    // work
    // properly on ack, since the original address will be overwritten

    // TODO we can optimise this so it doesn't copy if it's not routed anywhere else

    if (HornetQServerLogger.LOGGER.isTraceEnabled()) {
      HornetQServerLogger.LOGGER.trace("Diverting message " + message + " into " + this);
    }

    long id = storageManager.generateUniqueID();

    ServerMessage copy = message.copy(id);
    copy.finishCopy();

    // This will set the original MessageId, and the original address
    copy.setOriginalHeaders(message, null, false);

    copy.setAddress(forwardAddress);

    if (transformer != null) {
      copy = transformer.transform(copy);
    }

    postOffice.route(copy, context.getTransaction(), false);
  }
Пример #4
0
  public QueueQueryResult executeQueueQuery(final SimpleString name) throws Exception {
    if (name == null) {
      throw HornetQMessageBundle.BUNDLE.queueNameIsNull();
    }

    QueueQueryResult response;

    Binding binding = postOffice.getBinding(name);

    if (binding != null && binding.getType() == BindingType.LOCAL_QUEUE) {
      Queue queue = (Queue) binding.getBindable();

      Filter filter = queue.getFilter();

      SimpleString filterString = filter == null ? null : filter.getFilterString();

      response =
          new QueueQueryResult(
              name,
              binding.getAddress(),
              queue.isDurable(),
              queue.isTemporary(),
              filterString,
              queue.getConsumerCount(),
              queue.getMessageCount());
    }
    // make an exception for the management address (see HORNETQ-29)
    else if (name.equals(managementAddress)) {
      response = new QueueQueryResult(name, managementAddress, true, false, null, -1, -1);
    } else {
      response = new QueueQueryResult();
    }

    return response;
  }
Пример #5
0
  public void createConsumer(
      final long consumerID,
      final SimpleString queueName,
      final SimpleString filterString,
      final boolean browseOnly)
      throws Exception {
    Binding binding = postOffice.getBinding(queueName);

    if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE) {
      throw HornetQMessageBundle.BUNDLE.noSuchQueue(queueName);
    }

    securityStore.check(binding.getAddress(), CheckType.CONSUME, this);

    Filter filter = FilterImpl.createFilter(filterString);

    ServerConsumer consumer =
        new ServerConsumerImpl(
            consumerID,
            this,
            (QueueBinding) binding,
            filter,
            started,
            browseOnly,
            storageManager,
            callback,
            preAcknowledge,
            strictUpdateDeliveryCount,
            managementService);

    consumers.put(consumer.getID(), consumer);

    if (!browseOnly) {
      TypedProperties props = new TypedProperties();

      props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, binding.getAddress());

      props.putSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME, binding.getClusterName());

      props.putSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME, binding.getRoutingName());

      props.putIntProperty(ManagementHelper.HDR_DISTANCE, binding.getDistance());

      Queue theQueue = (Queue) binding.getBindable();

      props.putIntProperty(ManagementHelper.HDR_CONSUMER_COUNT, theQueue.getConsumerCount());

      if (filterString != null) {
        props.putSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING, filterString);
      }

      Notification notification = new Notification(null, CONSUMER_CREATED, props);

      managementService.sendNotification(notification);
    }
  }
Пример #6
0
  public void requestProducerCredits(final SimpleString address, final int credits)
      throws Exception {
    PagingStore store = postOffice.getPagingManager().getPageStore(address);

    store.executeRunnableWhenMemoryAvailable(
        new Runnable() {
          public void run() {
            callback.sendProducerCreditsMessage(credits, address);
          }
        });
  }
Пример #7
0
  protected List<QueueBinding> getLocalQueueBindings(
      final PostOffice postOffice, final String address) throws Exception {
    ArrayList<QueueBinding> bindingsFound = new ArrayList<QueueBinding>();

    Bindings bindings = postOffice.getBindingsForAddress(new SimpleString(address));

    for (Binding binding : bindings.getBindings()) {
      if (binding instanceof LocalQueueBinding) {
        bindingsFound.add((QueueBinding) binding);
      }
    }
    return bindingsFound;
  }
Пример #8
0
 public String[] getBindingNames() throws Exception {
   clearIO();
   try {
     Bindings bindings = postOffice.getBindingsForAddress(address);
     String[] bindingNames = new String[bindings.getBindings().size()];
     int i = 0;
     for (Binding binding : bindings.getBindings()) {
       bindingNames[i++] = binding.getUniqueName().toString();
     }
     return bindingNames;
   } catch (Throwable t) {
     throw new IllegalStateException(t.getMessage());
   } finally {
     blockOnIO();
   }
 }
Пример #9
0
  public void deleteQueue(final SimpleString name) throws Exception {
    Binding binding = postOffice.getBinding(name);

    if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE) {
      throw new NonExistentQueueException();
    }

    server.destroyQueue(name, this);

    TempQueueCleanerUpper cleaner = this.tempQueueCleannerUppers.remove(name);

    if (cleaner != null) {
      remotingConnection.removeCloseListener(cleaner);

      remotingConnection.removeFailureListener(cleaner);
    }
  }
Пример #10
0
 public String[] getQueueNames() throws Exception {
   clearIO();
   try {
     Bindings bindings = postOffice.getBindingsForAddress(address);
     List<String> queueNames = new ArrayList<String>();
     for (Binding binding : bindings.getBindings()) {
       if (binding instanceof QueueBinding) {
         queueNames.add(binding.getUniqueName().toString());
       }
     }
     return queueNames.toArray(new String[queueNames.size()]);
   } catch (Throwable t) {
     throw new IllegalStateException(t.getMessage());
   } finally {
     blockOnIO();
   }
 }
Пример #11
0
 public long getNumberOfMessages() throws Exception {
   clearIO();
   long totalMsgs = 0;
   try {
     Bindings bindings = postOffice.getBindingsForAddress(address);
     List<String> queueNames = new ArrayList<String>();
     for (Binding binding : bindings.getBindings()) {
       if (binding instanceof QueueBinding) {
         totalMsgs += ((QueueBinding) binding).getQueue().getMessageCount();
       }
     }
     return totalMsgs;
   } catch (Throwable t) {
     throw new IllegalStateException(t.getMessage());
   } finally {
     blockOnIO();
   }
 }
Пример #12
0
  public boolean moveMessage(
      final long messageID, final String otherQueueName, final boolean rejectDuplicates)
      throws Exception {
    checkStarted();

    clearIO();
    try {
      Binding binding = postOffice.getBinding(new SimpleString(otherQueueName));

      if (binding == null) {
        throw HornetQMessageBundle.BUNDLE.noQueueFound(otherQueueName);
      }

      return queue.moveReference(messageID, binding.getAddress(), rejectDuplicates);
    } finally {
      blockOnIO();
    }
  }
Пример #13
0
  public int moveMessages(
      final String filterStr, final String otherQueueName, final boolean rejectDuplicates)
      throws Exception {
    checkStarted();

    clearIO();
    try {
      Filter filter = FilterImpl.createFilter(filterStr);

      Binding binding = postOffice.getBinding(new SimpleString(otherQueueName));

      if (binding == null) {
        throw HornetQMessageBundle.BUNDLE.noQueueFound(otherQueueName);
      }

      int retValue = queue.moveReferences(filter, binding.getAddress(), rejectDuplicates);

      return retValue;
    } finally {
      blockOnIO();
    }
  }
Пример #14
0
  public BindingQueryResult executeBindingQuery(final SimpleString address) throws Exception {
    if (address == null) {
      throw HornetQMessageBundle.BUNDLE.addressIsNull();
    }

    List<SimpleString> names = new ArrayList<SimpleString>();

    // make an exception for the management address (see HORNETQ-29)
    if (address.equals(managementAddress)) {
      return new BindingQueryResult(true, names);
    }

    Bindings bindings = postOffice.getMatchingBindings(address);

    for (Binding binding : bindings.getBindings()) {
      if (binding.getType() == BindingType.LOCAL_QUEUE
          || binding.getType() == BindingType.REMOTE_QUEUE) {
        names.add(binding.getUniqueName());
      }
    }

    return new BindingQueryResult(!names.isEmpty(), names);
  }
Пример #15
0
  public synchronized void deployBridge(final BridgeConfiguration config) throws Exception {
    if (config.getName() == null) {
      HornetQServerLogger.LOGGER.bridgeNotUnique();

      return;
    }

    if (config.getQueueName() == null) {
      HornetQServerLogger.LOGGER.bridgeNoQueue(config.getName());

      return;
    }

    if (config.getForwardingAddress() == null) {
      HornetQServerLogger.LOGGER.bridgeNoForwardAddress(config.getName());
    }

    if (bridges.containsKey(config.getName())) {
      HornetQServerLogger.LOGGER.bridgeAlreadyDeployed(config.getName());

      return;
    }

    Transformer transformer = instantiateTransformer(config.getTransformerClassName());

    Binding binding = postOffice.getBinding(new SimpleString(config.getQueueName()));

    if (binding == null) {
      HornetQServerLogger.LOGGER.bridgeQueueNotFound(config.getQueueName(), config.getName());

      return;
    }

    Queue queue = (Queue) binding.getBindable();

    ServerLocatorInternal serverLocator;

    if (config.getDiscoveryGroupName() != null) {
      DiscoveryGroupConfiguration discoveryGroupConfiguration =
          configuration.getDiscoveryGroupConfigurations().get(config.getDiscoveryGroupName());
      if (discoveryGroupConfiguration == null) {
        HornetQServerLogger.LOGGER.bridgeNoDiscoveryGroup(config.getDiscoveryGroupName());

        return;
      }

      if (config.isHA()) {
        serverLocator =
            (ServerLocatorInternal)
                HornetQClient.createServerLocatorWithHA(discoveryGroupConfiguration);
      } else {
        serverLocator =
            (ServerLocatorInternal)
                HornetQClient.createServerLocatorWithoutHA(discoveryGroupConfiguration);
      }

    } else {
      TransportConfiguration[] tcConfigs = connectorNameListToArray(config.getStaticConnectors());

      if (tcConfigs == null) {
        HornetQServerLogger.LOGGER.bridgeCantFindConnectors(config.getName());
        return;
      }

      if (config.isHA()) {
        serverLocator = (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(tcConfigs);
      } else {
        serverLocator =
            (ServerLocatorInternal) HornetQClient.createServerLocatorWithoutHA(tcConfigs);
      }
    }

    if (config.getForwardingAddress() != null) {
      AddressSettings addressConfig =
          configuration.getAddressesSettings().get(config.getForwardingAddress());

      // The address config could be null on certain test cases or some Embedded environment
      if (addressConfig == null) {
        // We will certainly have this warning on testcases which is ok
        HornetQServerLogger.LOGGER.bridgeCantFindAddressConfig(
            config.getName(), config.getForwardingAddress());
      } else {
        final int windowSize = config.getConfirmationWindowSize();
        final long maxBytes = addressConfig.getMaxSizeBytes();

        if (maxBytes != -1 && maxBytes < windowSize) {
          HornetQServerLogger.LOGGER.bridgeConfirmationWindowTooSmall(
              config.getName(), config.getForwardingAddress(), windowSize, maxBytes);
        }
      }
    }

    serverLocator.setIdentity("Bridge " + config.getName());
    serverLocator.setConfirmationWindowSize(config.getConfirmationWindowSize());

    // We are going to manually retry on the bridge in case of failure
    serverLocator.setReconnectAttempts(0);
    serverLocator.setInitialConnectAttempts(0);
    serverLocator.setRetryInterval(config.getRetryInterval());
    serverLocator.setMaxRetryInterval(config.getMaxRetryInterval());
    serverLocator.setRetryIntervalMultiplier(config.getRetryIntervalMultiplier());
    serverLocator.setClientFailureCheckPeriod(config.getClientFailureCheckPeriod());
    serverLocator.setConnectionTTL(config.getConnectionTTL());
    serverLocator.setBlockOnDurableSend(!config.isUseDuplicateDetection());
    serverLocator.setBlockOnNonDurableSend(!config.isUseDuplicateDetection());
    serverLocator.setMinLargeMessageSize(config.getMinLargeMessageSize());
    // disable flow control
    serverLocator.setProducerWindowSize(-1);

    // This will be set to 30s unless it's changed from embedded / testing
    // there is no reason to exception the config for this timeout
    // since the Bridge is supposed to be non-blocking and fast
    // We may expose this if we find a good use case
    serverLocator.setCallTimeout(config.getCallTimeout());
    if (!config.isUseDuplicateDetection()) {
      HornetQServerLogger.LOGGER.debug(
          "Bridge "
              + config.getName()
              + " is configured to not use duplicate detecion, it will send messages synchronously");
    }

    clusterLocators.add(serverLocator);

    Bridge bridge =
        new BridgeImpl(
            serverLocator,
            config.getReconnectAttempts(),
            config.getReconnectAttemptsOnSameNode(),
            config.getRetryInterval(),
            config.getRetryIntervalMultiplier(),
            config.getMaxRetryInterval(),
            nodeManager.getUUID(),
            new SimpleString(config.getName()),
            queue,
            executorFactory.getExecutor(),
            FilterImpl.createFilter(config.getFilterString()),
            SimpleString.toSimpleString(config.getForwardingAddress()),
            scheduledExecutor,
            transformer,
            config.isUseDuplicateDetection(),
            config.getUser(),
            config.getPassword(),
            !backup,
            server.getStorageManager());

    bridges.put(config.getName(), bridge);

    managementService.registerBridge(bridge, config);

    bridge.start();
  }
Пример #16
0
  @Override
  public void nodeUP(final TopologyMember topologyMember, final boolean last) {
    if (stopping) {
      return;
    }
    final String nodeID = topologyMember.getNodeId();
    if (HornetQServerLogger.LOGGER.isDebugEnabled()) {
      String ClusterTestBase = "receiving nodeUP for nodeID=";
      HornetQServerLogger.LOGGER.debug(
          this + ClusterTestBase + nodeID + " connectionPair=" + topologyMember);
    }
    // discard notifications about ourselves unless its from our backup

    if (nodeID.equals(nodeManager.getNodeId().toString())) {
      if (HornetQServerLogger.LOGGER.isTraceEnabled()) {
        HornetQServerLogger.LOGGER.trace(
            this
                + "::informing about backup to itself, nodeUUID="
                + nodeManager.getNodeId()
                + ", connectorPair="
                + topologyMember
                + ", this = "
                + this);
      }
      return;
    }

    // if the node is more than 1 hop away, we do not create a bridge for direct cluster connection
    if (allowDirectConnectionsOnly && !allowableConnections.contains(topologyMember.getLive())) {
      return;
    }

    // FIXME required to prevent cluster connections w/o discovery group
    // and empty static connectors to create bridges... ulgy!
    if (serverLocator == null) {
      return;
    }
    /*we don't create bridges to backups*/
    if (topologyMember.getLive() == null) {
      if (isTrace) {
        HornetQServerLogger.LOGGER.trace(
            this
                + " ignoring call with nodeID="
                + nodeID
                + ", topologyMember="
                + topologyMember
                + ", last="
                + last);
      }
      return;
    }

    synchronized (recordsGuard) {
      try {
        MessageFlowRecord record = records.get(nodeID);

        if (record == null) {
          if (HornetQServerLogger.LOGGER.isDebugEnabled()) {
            HornetQServerLogger.LOGGER.debug(
                this
                    + "::Creating record for nodeID="
                    + nodeID
                    + ", topologyMember="
                    + topologyMember);
          }

          // New node - create a new flow record

          final SimpleString queueName = new SimpleString("sf." + name + "." + nodeID);

          Binding queueBinding = postOffice.getBinding(queueName);

          Queue queue;

          if (queueBinding != null) {
            queue = (Queue) queueBinding.getBindable();
          } else {
            // Add binding in storage so the queue will get reloaded on startup and we can find it -
            // it's never
            // actually routed to at that address though
            queue = server.createQueue(queueName, queueName, null, true, false);
          }

          createNewRecord(
              topologyMember.getUniqueEventID(),
              nodeID,
              topologyMember.getLive(),
              queueName,
              queue,
              true);
        } else {
          if (isTrace) {
            HornetQServerLogger.LOGGER.trace(
                this
                    + " ignored nodeUp record for "
                    + topologyMember
                    + " on nodeID="
                    + nodeID
                    + " as the record already existed");
          }
        }
      } catch (Exception e) {
        HornetQServerLogger.LOGGER.errorUpdatingTopology(e);
      }
    }
  }
Пример #17
0
 private void checkStarted() {
   if (!postOffice.isStarted()) {
     throw new IllegalStateException(
         "HornetQ Server is not started. Queue can not be managed yet");
   }
 }
Пример #18
0
  public synchronized void deployBridge(final BridgeConfiguration config, final boolean start)
      throws Exception {
    if (config.getName() == null) {
      ClusterManagerImpl.log.warn(
          "Must specify a unique name for each bridge. This one will not be deployed.");

      return;
    }

    if (config.getQueueName() == null) {
      ClusterManagerImpl.log.warn(
          "Must specify a queue name for each bridge. This one will not be deployed.");

      return;
    }

    if (config.getForwardingAddress() == null) {
      ClusterManagerImpl.log.debug(
          "Forward address is not specified. Will use original message address instead");
    }

    if (bridges.containsKey(config.getName())) {
      ClusterManagerImpl.log.warn(
          "There is already a bridge with name "
              + config.getName()
              + " deployed. This one will not be deployed.");

      return;
    }

    Transformer transformer = instantiateTransformer(config.getTransformerClassName());

    Binding binding = postOffice.getBinding(new SimpleString(config.getQueueName()));

    if (binding == null) {
      ClusterManagerImpl.log.warn(
          "No queue found with name " + config.getQueueName() + " bridge will not be deployed.");

      return;
    }

    Queue queue = (Queue) binding.getBindable();

    ServerLocatorInternal serverLocator;

    if (config.getDiscoveryGroupName() != null) {
      DiscoveryGroupConfiguration discoveryGroupConfiguration =
          configuration.getDiscoveryGroupConfigurations().get(config.getDiscoveryGroupName());
      if (discoveryGroupConfiguration == null) {
        ClusterManagerImpl.log.warn(
            "No discovery group configured with name '"
                + config.getDiscoveryGroupName()
                + "'. The bridge will not be deployed.");

        return;
      }

      if (config.isHA()) {
        serverLocator =
            (ServerLocatorInternal)
                HornetQClient.createServerLocatorWithHA(discoveryGroupConfiguration);
      } else {
        serverLocator =
            (ServerLocatorInternal)
                HornetQClient.createServerLocatorWithoutHA(discoveryGroupConfiguration);
      }

    } else {
      TransportConfiguration[] tcConfigs = connectorNameListToArray(config.getStaticConnectors());

      if (tcConfigs == null) {
        return;
      }

      if (config.isHA()) {
        serverLocator = (ServerLocatorInternal) HornetQClient.createServerLocatorWithHA(tcConfigs);
      } else {
        serverLocator =
            (ServerLocatorInternal) HornetQClient.createServerLocatorWithoutHA(tcConfigs);
      }
    }

    serverLocator.setConfirmationWindowSize(config.getConfirmationWindowSize());

    // We are going to manually retry on the bridge in case of failure
    serverLocator.setReconnectAttempts(0);
    serverLocator.setInitialConnectAttempts(-1);
    serverLocator.setRetryInterval(config.getRetryInterval());
    serverLocator.setMaxRetryInterval(config.getMaxRetryInterval());
    serverLocator.setRetryIntervalMultiplier(config.getRetryIntervalMultiplier());
    serverLocator.setClientFailureCheckPeriod(config.getClientFailureCheckPeriod());
    serverLocator.setBlockOnDurableSend(!config.isUseDuplicateDetection());
    serverLocator.setBlockOnNonDurableSend(!config.isUseDuplicateDetection());
    serverLocator.setMinLargeMessageSize(config.getMinLargeMessageSize());
    // disable flow control
    serverLocator.setProducerWindowSize(-1);

    // This will be set to 30s unless it's changed from embedded / testing
    // there is no reason to exception the config for this timeout
    // since the Bridge is supposed to be non-blocking and fast
    // We may expose this if we find a good use case
    serverLocator.setCallTimeout(config.getCallTimeout());
    if (!config.isUseDuplicateDetection()) {
      log.debug(
          "Bridge "
              + config.getName()
              + " is configured to not use duplicate detecion, it will send messages synchronously");
    }

    clusterLocators.add(serverLocator);

    Bridge bridge =
        new BridgeImpl(
            serverLocator,
            config.getReconnectAttempts(),
            config.getRetryInterval(),
            config.getRetryIntervalMultiplier(),
            config.getMaxRetryInterval(),
            nodeUUID,
            new SimpleString(config.getName()),
            queue,
            executorFactory.getExecutor(),
            SimpleString.toSimpleString(config.getFilterString()),
            SimpleString.toSimpleString(config.getForwardingAddress()),
            scheduledExecutor,
            transformer,
            config.isUseDuplicateDetection(),
            config.getUser(),
            config.getPassword(),
            !backup,
            server.getStorageManager());

    bridges.put(config.getName(), bridge);

    managementService.registerBridge(bridge, config);

    if (start) {
      bridge.start();
    }
  }
Пример #19
0
  public void createConsumer(
      final long consumerID,
      final SimpleString queueName,
      final SimpleString filterString,
      final boolean browseOnly,
      final boolean supportLargeMessage,
      final Integer credits)
      throws Exception {
    Binding binding = postOffice.getBinding(queueName);

    if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE) {
      throw HornetQMessageBundle.BUNDLE.noSuchQueue(queueName);
    }

    securityStore.check(binding.getAddress(), CheckType.CONSUME, this);

    Filter filter = FilterImpl.createFilter(filterString);

    ServerConsumer consumer =
        new ServerConsumerImpl(
            consumerID,
            this,
            (QueueBinding) binding,
            filter,
            started,
            browseOnly,
            storageManager,
            callback,
            preAcknowledge,
            strictUpdateDeliveryCount,
            managementService,
            supportLargeMessage,
            credits);
    consumers.put(consumer.getID(), consumer);

    if (!browseOnly) {
      TypedProperties props = new TypedProperties();

      props.putSimpleStringProperty(ManagementHelper.HDR_ADDRESS, binding.getAddress());

      props.putSimpleStringProperty(ManagementHelper.HDR_CLUSTER_NAME, binding.getClusterName());

      props.putSimpleStringProperty(ManagementHelper.HDR_ROUTING_NAME, binding.getRoutingName());

      props.putIntProperty(ManagementHelper.HDR_DISTANCE, binding.getDistance());

      Queue theQueue = (Queue) binding.getBindable();

      props.putIntProperty(ManagementHelper.HDR_CONSUMER_COUNT, theQueue.getConsumerCount());

      // HORNETQ-946
      props.putSimpleStringProperty(
          ManagementHelper.HDR_USER, SimpleString.toSimpleString(username));

      props.putSimpleStringProperty(
          ManagementHelper.HDR_REMOTE_ADDRESS,
          SimpleString.toSimpleString(this.remotingConnection.getRemoteAddress()));

      props.putSimpleStringProperty(
          ManagementHelper.HDR_SESSION_NAME, SimpleString.toSimpleString(name));

      if (filterString != null) {
        props.putSimpleStringProperty(ManagementHelper.HDR_FILTERSTRING, filterString);
      }

      Notification notification = new Notification(null, CONSUMER_CREATED, props);

      if (HornetQServerLogger.LOGGER.isDebugEnabled()) {
        HornetQServerLogger.LOGGER.debug(
            "Session with user="******", connection="
                + this.remotingConnection
                + " created a consumer on queue "
                + queueName
                + ", filter = "
                + filterString);
      }

      managementService.sendNotification(notification);
    }
  }