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

Ask Your Question
0

PollingContainer FIFO

Hi,

Further to my previous question here I have moved on to working with Polling Containers.

There doesn't seem to be a simple way of enabling FIFO through the SimplePollingContainerConfigurer as there is with the SimpleNotifyContainerConfigurer. There is no .fifo(boolean) method. According to the docs here I have to use a FIFO Group.

Am I missing anything? Is there a simpler way to enable FIFO for PollingContainers? Can FIFO Groups only contain one class? Or can I have Class A and Class B in a group together by annotating a field in each?

Many thanks for any help. John.

asked 2015-06-22 08:37:54 -0500

jmg gravatar image

updated 2015-06-22 08:39:56 -0500

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

You should set the gigaSpace.getSpace().setReadModifiers(com.j_spaces.core.client.TakeModifiers.FIFO) and annotate the space class with @SpaceClass(fifoSupport=FifoSupport.OPERATION).

This will instruct the polling container to run in FIFO mode. This must be a collocated polling container. A remote polling container can't run in global FIFO mode across all partitions.

See also: http://docs.gigaspaces.com/xap101/fif... https://github.com/OpenSpaces/OpenSpa...

answered 2015-06-23 04:25:27 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

It is a remote space so this option won't work. I may have to rethink my approach. Thanks.

jmg gravatar imagejmg ( 2015-06-23 05:21:54 -0500 )edit
1

You're not missing anything, there is no simple way. My understanding of the following is that it indicates that you can only have one class:

There can be only one FG property per type.

I would suggest that you pay careful attention the following section of the documentation, particularly the 'Considerations' & 'Performance Hints' sections.

http://docs.gigaspaces.com/xap101/fif...

If you can describe at a high level what you're trying to achieve we may be able to provide better guidance.

Regards

John

answered 2015-06-22 15:50:06 -0500

jb gravatar image
edit flag offensive delete link more

Comments

I was just curious as to why there is no .fifo(boolean) method on the PollingContainer. Implementing FIFO using groups will take a little more thought and effort. My use case is:

My use case is that I have a "global" polling container listening for Commands of type A. Class B and Class C etc. all extend Class A. So I use A as my template which allows me to receive all subclasses of A, namely B and C etc. If I wish to enable FIFO like I have for my NotifyContainers then I would have to change my approach to use FIFO Groups and I would also have to use separate PollingContainers for each concrete type. There are a lot of command classes which extend A, over 20 at the moment, with many more envisioned. Each of these commands have their own properties and internal objects.

I took "There can be only one FG property per type" to mean that there can only be one FG property per class but I thought perhaps FIFO Groups would allow me to have several different classes with the same FG property value and they would be placed in the same group. Nowhere in the docs does it explicitly say that Groups can only contain one type. I guess it's implicit as FIFO Groups are an extension of normal FIFO functionality which only guarantees FIFO per class.

Thanks for the help. John.

jmg gravatar imagejmg ( 2015-06-23 04:19:31 -0500 )edit

I had a long comment there, does the rest of it load for everyone when you click "more"?

jmg gravatar imagejmg ( 2015-06-23 04:26:10 -0500 )edit

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

Stats

Asked: 2015-06-22 08:37:54 -0500

Seen: 565 times

Last updated: Jun 23 '15