You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2012/08/18 15:31:09 UTC

svn commit: r1374577 - in /activemq/activemq-apollo/trunk: apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/ apollo-broker/src/test/scala/ apollo-dto/src/main/java/org/apache/activemq/apollo/dto/ apollo-web/src/main/scala/org/apache/activ...

Author: chirino
Date: Sat Aug 18 13:31:09 2012
New Revision: 1374577

URL: http://svn.apache.org/viewvc?rev=1374577&view=rev
Log:
Only display the producers and consumers in the admin view if requested.  This helps keep the admin screens snappier when a single destination has thousands of producers/consumers attached.

Modified:
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
    activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java
    activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/QueueStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/TopicStatusDTO.jade
    activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Binding.scala Sat Aug 18 13:31:09 2012
@@ -255,14 +255,14 @@ object TempQueueBinding {
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-case class TempQueueBinding(key:AnyRef, address:DestinationAddress, settings:QueueSettingsDTO) extends Binding {
+case class TempQueueBinding(topic:String, key:AnyRef, address:DestinationAddress, settings:QueueSettingsDTO) extends Binding {
   import TempQueueBinding._
 
   def binding_kind = TEMP_KIND
   def binding_data = TEMP_DATA
 
 
-  override def dto: DestinationDTO = null
+  override def dto: DestinationDTO = new TopicDestinationDTO(topic)
   def dto_class = null
 
   def unbind(router: LocalRouter, queue: Queue) = {}

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Queue.scala Sat Aug 18 13:31:09 2012
@@ -302,13 +302,21 @@ class Queue(val router: LocalRouter, val
     rc
   }
 
-  def status(entries:Boolean=false) = {
+  def status(entries:Boolean=false, include_producers:Boolean=false, include_consumers:Boolean=false) = {
     val rc = new QueueStatusDTO
     rc.id = this.id
+    binding match {
+      case binding:TempQueueBinding =>
+        rc.id = store_id.toString
+      case _ =>
+    }
     rc.state = this.service_state.toString
     rc.state_since = this.service_state.since
     rc.binding = this.binding.dto
     rc.config = this.config
+    if( max_enqueue_rate < Int.MaxValue ) {
+      rc.max_enqueue_rate = new Integer(max_enqueue_rate)
+    }
     rc.metrics = this.get_queue_metrics
     rc.metrics.current_time = now
 
@@ -332,61 +340,71 @@ class Queue(val router: LocalRouter, val
           cur.nextOrTail
         }
       }
+    } else {
+      rc.entries = null
     }
 
-    this.inbound_sessions.foreach { session:DeliverySession =>
-      val link = new LinkDTO()
-      session.producer.connection match {
-        case Some(connection) =>
-          link.kind = "connection"
-          link.id = connection.id.toString
-          link.label = connection.transport.getRemoteAddress.toString
-        case _ =>
-          link.kind = "unknown"
-          link.label = "unknown"
-      }
-      link.enqueue_item_counter = session.enqueue_item_counter
-      link.enqueue_size_counter = session.enqueue_size_counter
-      link.enqueue_ts = session.enqueue_ts
-      rc.producers.add(link)
-    }
-
-    this.all_subscriptions.valuesIterator.toSeq.foreach{ sub =>
-      val link = new QueueConsumerLinkDTO
-      sub.consumer.connection match {
-        case Some(connection) =>
-          link.kind = "connection"
-          link.id = connection.id.toString
-          link.label = connection.transport.getRemoteAddress.toString
-        case _ =>
-          link.kind = "unknown"
-          link.label = "unknown"
-      }
-      link.position = sub.pos.seq
-      link.enqueue_item_counter = sub.session.enqueue_item_counter
-      link.enqueue_size_counter = sub.session.enqueue_size_counter
-      link.enqueue_ts = sub.session.enqueue_ts
-      link.total_ack_count = sub.total_ack_count
-      link.total_nack_count = sub.total_nack_count
-      link.acquired_size = sub.acquired_size
-      link.acquired_count = sub.acquired_count
-      sub.ack_rates match {
-        case Some((items_per_sec, size_per_sec) ) =>
-          link.ack_item_rate = items_per_sec
-          link.ack_size_rate = size_per_sec
-        case _ =>
+    if( include_producers ) {
+      for ( session <- this.inbound_sessions ) {
+        val link = new LinkDTO()
+        session.producer.connection match {
+          case Some(connection) =>
+            link.kind = "connection"
+            link.id = connection.id.toString
+            link.label = connection.transport.getRemoteAddress.toString
+          case _ =>
+            link.kind = "unknown"
+            link.label = "unknown"
+        }
+        link.enqueue_item_counter = session.enqueue_item_counter
+        link.enqueue_size_counter = session.enqueue_size_counter
+        link.enqueue_ts = session.enqueue_ts
+        rc.producers.add(link)
       }
+    } else {
+      rc.producers = null
+    }
 
-      link.waiting_on = if( sub.full ) {
-        "consumer"
-      } else if( sub.pos.is_tail ) {
-        "producer"
-      } else if( !sub.pos.is_loaded ) {
-        "load"
-      } else {
-        "dispatch"
+    if( include_consumers ) {
+      for( sub <- this.all_subscriptions.values ) {
+        val link = new QueueConsumerLinkDTO
+        sub.consumer.connection match {
+          case Some(connection) =>
+            link.kind = "connection"
+            link.id = connection.id.toString
+            link.label = connection.transport.getRemoteAddress.toString
+          case _ =>
+            link.kind = "unknown"
+            link.label = "unknown"
+        }
+        link.position = sub.pos.seq
+        link.enqueue_item_counter = sub.session.enqueue_item_counter
+        link.enqueue_size_counter = sub.session.enqueue_size_counter
+        link.enqueue_ts = sub.session.enqueue_ts
+        link.total_ack_count = sub.total_ack_count
+        link.total_nack_count = sub.total_nack_count
+        link.acquired_size = sub.acquired_size
+        link.acquired_count = sub.acquired_count
+        sub.ack_rates match {
+          case Some((items_per_sec, size_per_sec) ) =>
+            link.ack_item_rate = items_per_sec
+            link.ack_size_rate = size_per_sec
+          case _ =>
+        }
+
+        link.waiting_on = if( sub.full ) {
+          "consumer"
+        } else if( sub.pos.is_tail ) {
+          "producer"
+        } else if( !sub.pos.is_loaded ) {
+          "load"
+        } else {
+          "dispatch"
+        }
+        rc.consumers.add(link)
       }
-      rc.consumers.add(link)
+    } else {
+      rc.consumers = null
     }
     rc
   }

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/Topic.scala Sat Aug 18 13:31:09 2012
@@ -192,15 +192,15 @@ class Topic(val router:LocalRouter, val 
 
   def slow_consumer_policy = config.slow_consumer_policy.getOrElse("block")
 
-  def status: FutureResult[TopicStatusDTO] = {
+  def status(show_producers:Boolean, show_consumers:Boolean): FutureResult[TopicStatusDTO] = {
     val rc = FutureResult[TopicStatusDTO]()
-    status(x => rc.set(Success(x)))
+    status(show_producers, show_consumers, x => rc.set(Success(x)))
     rc
   }
 
   var state = "STARTED"
 
-  def status(on_complete:(TopicStatusDTO)=>Unit) = {
+  def status(show_producers:Boolean, show_consumers:Boolean, on_complete:(TopicStatusDTO)=>Unit):Unit = {
     dispatch_queue.assertExecuting()
 
     val rc = new TopicStatusDTO
@@ -262,6 +262,13 @@ class Topic(val router:LocalRouter, val 
       add_enqueue_counters(rc.metrics, link)
     }
 
+    if( !show_producers ) {
+      rc.producers = null
+    }
+    if( !show_consumers ) {
+      rc.consumers = null
+    }
+
     var futures = List[Future[(TopicStatusDTO)=>Unit]]()
 
     consumers_links.foreach { case (consumer, link) =>
@@ -361,7 +368,7 @@ class Topic(val router:LocalRouter, val 
           case "queue" =>
 
             // create a temp queue so that it can spool
-            val queue = router._create_queue(new TempQueueBinding(consumer, address, Option(config.subscription).getOrElse(new QueueSettingsDTO)))
+            val queue = router._create_queue(new TempQueueBinding(id, consumer, address, Option(config.subscription).getOrElse(new QueueSettingsDTO)))
             queue.dispatch_queue.setTargetQueue(consumer.dispatch_queue)
             queue.bind(List(consumer))
             consumer_queues += consumer->queue

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/main/scala/org/apache/activemq/apollo/broker/VirtualHost.scala Sat Aug 18 13:31:09 2012
@@ -300,7 +300,7 @@ class VirtualHost(val broker: Broker, va
   def get_topic_metrics:FutureResult[AggregateDestMetricsDTO] = sync(this) {
     val topics:Iterable[Topic] = local_router.local_topic_domain.destinations
     val metrics: Future[Iterable[Result[DestMetricsDTO, Throwable]]] = Future.all {
-      topics.map(_.status.map(_.map_success(_.metrics)))
+      topics.map(_.status(false, false).map(_.map_success(_.metrics)))
     }
     metrics.map( x => Success {
       val rc = aggregate_dest_metrics(x.flatMap(_.success_option))

Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/BrokerFunSuiteSupport.scala Sat Aug 18 13:31:09 2012
@@ -64,7 +64,7 @@ object BrokerTestSupport {
     val host = broker.default_virtual_host
     sync(host) {
       val router = host.router.asInstanceOf[LocalRouter]
-      router.local_topic_domain.destination_by_id.get(name).get.status
+      router.local_topic_domain.destination_by_id.get(name).get.status(true, true)
     }
   }
 

Modified: activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java (original)
+++ activemq/activemq-apollo/trunk/apollo-dto/src/main/java/org/apache/activemq/apollo/dto/QueueStatusDTO.java Sat Aug 18 13:31:09 2012
@@ -60,4 +60,6 @@ public class QueueStatusDTO extends Serv
     @XmlElement(name="consumer")
     public List<QueueConsumerLinkDTO> consumers = new ArrayList<QueueConsumerLinkDTO>();
 
+    @XmlAttribute(name="max_enqueue_rate")
+    public Integer max_enqueue_rate;
 }
\ No newline at end of file

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/scala/org/apache/activemq/apollo/web/resources/BrokerResource.scala Sat Aug 18 13:31:09 2012
@@ -505,7 +505,7 @@ class BrokerResource() extends Resource 
       val records = Future.all {
         router.local_topic_domain.destination_by_id.values.map { value  =>
           monitoring(value) {
-            value.status
+            value.status(false, false)
           }
         }
       }
@@ -516,12 +516,14 @@ class BrokerResource() extends Resource 
 
   @GET @Path("/virtual-hosts/{id}/topics/{name:.*}")
   @ApiOperation(value = "Gets the status of the named topic.")
-  def topic(@PathParam("id") id : String, @PathParam("name") name : String):TopicStatusDTO = {
+  def topic(@PathParam("id") id : String, @PathParam("name") name : String,
+            @QueryParam("producers") producers:Boolean,
+            @QueryParam("consumers") consumers:Boolean):TopicStatusDTO = {
     with_virtual_host(id) { host =>
       val router:LocalRouter = host
       val node = router.local_topic_domain.destination_by_id.get(name).getOrElse(result(NOT_FOUND))
       monitoring(node) {
-        node.status
+        node.status(producers, consumers)
       }
     }
   }
@@ -549,14 +551,17 @@ class BrokerResource() extends Resource 
 
   @GET @Path("/virtual-hosts/{id}/topic-queues/{name:.*}/{qid}")
   @ApiOperation(value = "Gets the status of a topic consumer queue.")
-  def topic(@PathParam("id") id : String,@PathParam("name") name : String,  @PathParam("qid") qid : Long, @QueryParam("entries") entries:Boolean):QueueStatusDTO = {
+  def topic(@PathParam("id") id : String,@PathParam("name") name : String,  @PathParam("qid") qid : Long,
+            @QueryParam("entries") entries:Boolean,
+            @QueryParam("producers") producers:Boolean,
+            @QueryParam("consumers") consumers:Boolean):QueueStatusDTO = {
     with_virtual_host(id) { host =>
       val router:LocalRouter = host
       val node = router.local_topic_domain.destination_by_id.get(name).getOrElse(result(NOT_FOUND))
       val queue =router.queues_by_store_id.get(qid).getOrElse(result(NOT_FOUND))
       monitoring(node) {
         sync(queue) {
-          queue.status(entries)
+          queue.status(entries, producers, consumers)
         }
       }
     }
@@ -572,7 +577,7 @@ class BrokerResource() extends Resource 
       val values: Iterable[Queue] = router.local_queue_domain.destination_by_id.values
 
       val records = sync_all(values) { value =>
-        status(value, false)
+        status(value, false, false , false)
       }
 
       val rc:FutureResult[DataPageDTO] = records.map(narrow(classOf[QueueStatusDTO], _, f, q, p, ps, o))
@@ -582,12 +587,15 @@ class BrokerResource() extends Resource 
 
   @GET @Path("/virtual-hosts/{id}/queues/{name:.*}")
   @ApiOperation(value = "Gets the status of the named queue.")
-  def queue(@PathParam("id") id : String, @PathParam("name") name : String, @QueryParam("entries") entries:Boolean ):QueueStatusDTO = {
+  def queue(@PathParam("id") id : String, @PathParam("name") name : String,
+            @QueryParam("entries") entries:Boolean,
+            @QueryParam("producers") producers:Boolean,
+            @QueryParam("consumers") consumers:Boolean ):QueueStatusDTO = {
     with_virtual_host(id) { host =>
       val router: LocalRouter = host
       val node = router.local_queue_domain.destination_by_id.get(name).getOrElse(result(NOT_FOUND))
       sync(node) {
-        status(node, entries)
+        status(node, entries, producers, consumers)
       }
     }
   }
@@ -625,7 +633,7 @@ class BrokerResource() extends Resource 
       val values: Iterable[Queue] = router.local_dsub_domain.destination_by_id.values
 
       val records = sync_all(values) { value =>
-        status(value, false)
+        status(value, false, false, false)
       }
 
       val rc:FutureResult[DataPageDTO] = records.map(narrow(classOf[QueueStatusDTO], _, f, q, p, ps, o))
@@ -635,12 +643,15 @@ class BrokerResource() extends Resource 
 
   @GET @Path("/virtual-hosts/{id}/dsubs/{name:.*}")
   @ApiOperation(value = "Gets the status of the named durable subscription.")
-  def durable_subscription(@PathParam("id") id : String, @PathParam("name") name : String, @QueryParam("entries") entries:Boolean):QueueStatusDTO = {
+  def durable_subscription(@PathParam("id") id : String, @PathParam("name") name : String,
+                           @QueryParam("entries") entries:Boolean,
+                           @QueryParam("producers") producers:Boolean,
+                           @QueryParam("consumers") consumers:Boolean):QueueStatusDTO = {
     with_virtual_host(id) { host =>
       val router:LocalRouter = host
       val node = router.local_dsub_domain.destination_by_id.get(name).getOrElse(result(NOT_FOUND))
       sync(node) {
-        status(node, entries)
+        status(node, entries, producers, consumers)
       }
     }
   }
@@ -678,8 +689,8 @@ class BrokerResource() extends Resource 
     }
   }
 
-  def status(q:Queue, entries:Boolean=false) = monitoring(q) {
-    q.status(entries)
+  def status(q:Queue, entries:Boolean=false, producers:Boolean, consumers:Boolean) = monitoring(q) {
+    q.status(entries, producers, consumers)
   }
 
   @GET @Path("/connectors")

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/QueueStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/QueueStatusDTO.jade?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/QueueStatusDTO.jade (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/QueueStatusDTO.jade Sat Aug 18 13:31:09 2012
@@ -46,14 +46,13 @@
       form(method="post" action={path("action/delete")})
         input(type="submit" value="delete")
 
-  - case _ =>
-    - vhost_path = "../.."
+  - case x:TopicDestinationDTO =>
+    - vhost_path = "../../topics/"+x.name
     .breadcumbs
       a(href={strip_resolve(vhost_path)+".html"}) Back
     h1 Temporary Queue
     p state: #{state} #{ uptime(state_since) } ago
 
-
 h2 Current Size
 
 p queue size: #{metrics.queue_items} messages #{memory(metrics.queue_size)}
@@ -69,6 +68,13 @@ p nacked: #{metrics.nack_item_counter} m
 
 p expired: #{metrics.expired_item_counter} messages (#{memory(metrics.expired_size_counter)}), #{uptime(metrics.expired_ts)} ago
 
+p
+  | enqueue rate throttle:
+  - if (max_enqueue_rate==null)
+    | none
+  - else
+    | #{max_enqueue_rate} messages/sec
+
 h2 Swap Metrics
 
 p swapped in: #{metrics.swapped_in_items} messages #{memory(metrics.swapped_in_size)}
@@ -83,49 +89,59 @@ p swapping in: #{memory(metrics.swapping
 p total swap outs : #{metrics.swap_out_item_counter} messages (#{memory(metrics.swap_out_size_counter)})
 p total swap ins : #{metrics.swap_in_item_counter} messages (#{memory(metrics.swap_in_size_counter)})
 
-h3 Producers
+h2 Producers
+p producers: #{metrics.producer_count}
 p total producers ever : #{metrics.producer_counter}
-ul
-  - for( x <- producers )
-    li.producer
-      - x.kind match
-        - case "queue" =>
-          a(href={ path(vhost_path+"/../queues/"+x.id+".html") }) #{x.label}
-        - case "connection" =>
-          a(href={ path(vhost_path+"/../../../connections/"+x.id+".html") }) #{x.label}
-        - case _ =>
-      p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
+p
+  - if ( producers == null )
+    a(href={ id+".html?producers=true" }) (Show Producers)
+  - else
+    a(href={ id+".html" }) (Hide Producers)
+    ul
+      - for( x <- producers )
+        li.producer
+          - x.kind match
+            - case "queue" =>
+              a(href={ path(vhost_path+"/../queues/"+x.id+".html") }) #{x.label}
+            - case "connection" =>
+              a(href={ path(vhost_path+"/../../../connections/"+x.id+".html") }) #{x.label}
+            - case _ =>
+          p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
 
 
-h3 Consumers
+h2 Consumers
+p consumers: #{metrics.consumer_count}
 p total consumers ever : #{metrics.consumer_counter}
-ul
-  - for( x <- consumers )
-    li.consumer
-      - x.kind match
-        - case "queue" =>
-          a(href={ path(vhost_path+"/../queues/"+x.id+".html") }) #{x.label}
-        - case "connection" =>
-          a(href={ path(vhost_path+"/../../../connections/"+x.id+".html") }) #{x.label}
-        - case _ =>
-      p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
-      p next message seq: #{x.position}
-      p acquired: #{x.acquired_count} messages (#{memory(x.acquired_size)})
-      p acks: #{x.total_ack_count} messages
-      p naks: #{x.total_nack_count} messages
-      p waiting on: #{x.waiting_on}
-      p acks per second: #{x.ack_item_rate}
-      p bytes acked per second: #{x.ack_size_rate}
-
-
+p
+  - if ( consumers == null )
+    a(href={ id+".html?consumers=true" }) (Show Consumers)
+  - else
+    a(href={ id+".html" }) (Hide Consumers)
+    ul
+      - for( x <- consumers )
+        li.consumer
+          - x.kind match
+            - case "queue" =>
+              a(href={ path(vhost_path+"/../queues/"+x.id+".html") }) #{x.label}
+            - case "connection" =>
+              a(href={ path(vhost_path+"/../../../connections/"+x.id+".html") }) #{x.label}
+            - case _ =>
+          p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
+          p next message seq: #{x.position}
+          p acquired: #{x.acquired_count} messages (#{memory(x.acquired_size)})
+          p acks: #{x.total_ack_count} messages
+          p naks: #{x.total_nack_count} messages
+          p waiting on: #{x.waiting_on}
+          p acks per second: #{x.ack_item_rate}
+          p bytes acked per second: #{x.ack_size_rate}
 
-- if ( entries.isEmpty )
+- if ( entries == null )
   h2
-    Entries Dump
+    | Entries Dump
     a(href={ id+".html?entries=true" }) (Show)
 - else
   h2
-    Entries Dump
+    | Entries Dump
     a(href={ id+".html" })  (Hide)
   table.queue-entries
     tr

Modified: activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/TopicStatusDTO.jade
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/TopicStatusDTO.jade?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/TopicStatusDTO.jade (original)
+++ activemq/activemq-apollo/trunk/apollo-web/src/main/webapp/WEB-INF/org/apache/activemq/apollo/dto/TopicStatusDTO.jade Sat Aug 18 13:31:09 2012
@@ -36,32 +36,44 @@ p enqueued: #{metrics.enqueue_item_count
 p dequeued: #{metrics.dequeue_item_counter} messages (#{memory(metrics.dequeue_size_counter)}), #{uptime(metrics.dequeue_ts)} ago
 
 h4 Producers
+p producers: #{metrics.producer_count}
 p total producers ever : #{metrics.producer_counter}
-ul
-  - for( x <- producers )
-    li.producer
-      - x.kind match
-        - case "queue" =>
-          a(href={ path("../../queues/"+x.id+".html") }) #{x.label}
-        - case "connection" =>
-          a(href={ path("../../../../connections/"+x.id+".html") }) #{x.label}
-        - case _ =>
-      p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
+p
+  - if ( producers == null )
+    a(href={ id+".html?producers=true" }) (Show Producers)
+  - else
+    a(href={ id+".html" }) (Hide Producers)
+    ul
+      - for( x <- producers )
+        li.producer
+          - x.kind match
+            - case "queue" =>
+              a(href={ path("../../queues/"+x.id+".html") }) #{x.label}
+            - case "connection" =>
+              a(href={ path("../../../../connections/"+x.id+".html") }) #{x.label}
+            - case _ =>
+          p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
 
 h4 Consumers
+p consumers: #{metrics.consumer_count}
 p total consumers ever : #{metrics.consumer_counter}
-ul
-  - for( x <- consumers )
-    li.consumer
-      - x.kind match
-        - case "topic-queue" =>
-          a(href={ path("../../topic-queues/"+id+"/"+x.id+".html") }) #{x.label}
-        - case "queue" =>
-          a(href={ path("../../queues/"+x.id+".html") }) #{x.label}
-        - case "connection" =>
-          a(href={ path("../../../../connections/"+x.id+".html") }) #{x.label}
-        - case _ =>
-      p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
+p
+  - if ( consumers == null )
+    a(href={ id+".html?consumers=true" }) (Show Consumers)
+  - else
+    a(href={ id+".html" }) (Hide Consumers)
+    ul
+      - for( x <- consumers )
+        li.consumer
+          - x.kind match
+            - case "topic-queue" =>
+              a(href={ path("../../topic-queues/"+id+"/"+x.id+".html") }) #{x.label}
+            - case "queue" =>
+              a(href={ path("../../queues/"+x.id+".html") }) #{x.label}
+            - case "connection" =>
+              a(href={ path("../../../../connections/"+x.id+".html") }) #{x.label}
+            - case _ =>
+          p dispatched: #{x.enqueue_item_counter} messages (#{memory(x.enqueue_size_counter)}), #{uptime(x.enqueue_ts)} ago
 
 h4 Durable Subscribers
 ul

Modified: activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md?rev=1374577&r1=1374576&r2=1374577&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md (original)
+++ activemq/activemq-apollo/trunk/apollo-website/src/documentation/management-api.md Sat Aug 18 13:31:09 2012
@@ -447,7 +447,12 @@ parameter to define the order in which t
     :markdown
       Gets metrics and details about the `{dest}` queue on the `{host}` virtual host. Example:
       
-      `curl -u "admin:password" http://localhost:61680/broker/virtual-hosts/default/queues/example-5.json`
+      You can the `?producers=true` query parameter to have a list of producers
+      included n the result.
+      You can the `?consumers=true` query parameter to have a list of consumers
+      included n the result.
+      
+      `curl -u "admin:password" http://localhost:61680/broker/virtual-hosts/default/queues/example-5.json?producers=true&consumers=true`
       {pygmentize:: js}
       {
         "id": "example-5",
@@ -550,8 +555,13 @@ parameter to define the order in which t
   - route("GET", "/broker/virtual-hosts/{host}/topics/{dest}.json", 200, "TopicStatusDTO")
     :markdown
       Gets metrics and details about the `{dest}` topic on the `{host}` virtual host.  Example:
+
+      You can the `?producers=true` query parameter to have a list of producers
+      included n the result.
+      You can the `?consumers=true` query parameter to have a list of consumers
+      included n the result.
       
-      `curl -u "admin:password" http://localhost:61680/broker/virtual-hosts/default/topics/example-2.json`
+      `curl -u "admin:password" http://localhost:61680/broker/virtual-hosts/default/topics/example-2.json?producers=true&consumers=true`
       {pygmentize:: js}
       {
         "id": "example-2",