Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Real time view of objects in FIFO group

What would be the most efficient way to get a near real time (1sec interval) view of the current count of objects in a FIFO queue? (for a live dashboard view)

We have a partitioned space and want to query or push the size of the queues every N seconds to a remote client. We do not really need a map-reduce because there is no reduce step necessary, the queue sizes in both partitions are independent from each other so its only about reading the current count of objects in those queues. Thats why I thought about locally reading the data from the space on every partition and pushing them to the remote client.

If I would query I do not want to what for the result when any partition is currently not responding, instead i want to immediatly return the results from all other partitions to display them.

I have read about the Finding Paritition Load example "http://docs.gigaspaces.com/sbp/finding-partition-load.html" but this seems to be outdated because it states: Recently tested with XAP 7.1.2. I also took a quick look at "http://docs.gigaspaces.com/sbp/time-series.html" both solutions are using map-reduce.. and i think this is not the optimal way to solve our problem.

Edit: Concrete Use case
We have the following types FIFO grouped and multiple Services/Components per partition. Each of this Services has a polling container with a different template.

ServiceA has template: Message with destinnation = ServiceA
ServiceB has template: Message with destinnation = ServiceB

We would like to see the queue sizes for each of those Services, note that they query the same object type but with a different template.

The dashboard would show something like:

  • ServiceA Partition1 = 40 messages in queue
  • ServiceA Partition2 = 10 messages in queue
  • ServiceB Partition1 = 4220 messages in queue
  • ServiceB Partition2 = 14 messages in queue

We expect a maximum of 2000 messages in a queue based on the current incoming data rate and message handling rate.

public class Message {
   @SpaceIndexes({@SpaceIndex, @SpaceIndex(path = "component")})
   public Address getDestination();

   public Object getSomeOtherProperty();

public class Address {
    public String getComponent();
    public String getRefId();

asked 2015-04-27 12:44:58 -0500

leozilla gravatar image

updated 2015-04-28 15:05:09 -0500

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-04-28 12:27:15 -0500

shay hassidim gravatar image

updated 2015-04-28 15:02:46 -0500

edit flag offensive delete link more


Please see my edit of the original question. We would need a way to group the objects based on a criteria (query/template).. Can this be done using the SpaceStatistics API?

leozilla gravatar imageleozilla ( 2015-04-28 15:07:32 -0500 )edit

SpaceStatistics API won't help here.

answered 2015-04-28 16:08:53 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-04-27 12:44:58 -0500

Seen: 120 times

Last updated: Apr 28 '15