Why bucket.QueuePop() every time get the the same same top item but delete the last one?

I want to use bucket.QueuePop(key) get my item as normal queue ;but! it always get the top item and delete the last item,so that every time i got the same item,it is wrong logic.who can explan it for me??

Hi @Andy_Wang

What version of the .NET SDK are you using? Could you provide a code example of what you’re having difficulty with?

Thanks

1 Like

client 2.5.5, server 2.6.4
push is ok:
IBucket bucket = null;
try
{
if (dicBuckets.ContainsKey(bucketType.ToString()))
{
bucket = dicBuckets[bucketType.ToString()];
}
else
{
bucket = cluster.OpenBucket(bucketType.ToString());
dicBuckets[bucketType.ToString()] = bucket;
}
var results = bucket.QueuePush(key, content, true);

            if (results.Success)
            {
                return true;
            }
            return false;

but outqueue is not what i need

        IBucket bucket = null;
        try
        {
            
            if (dicBuckets.ContainsKey(bucketType.ToString()))
            {
                bucket = dicBuckets[bucketType.ToString()];
            }
            else
            {
                bucket = cluster.OpenBucket(bucketType.ToString());
                dicBuckets[bucketType.ToString()] = bucket;
            }

            var results = bucket.QueuePop<T>(key);

            if (results.Success)
            {
                    return results.Value;
            }
            return default(T);
        }

for example my queue in bucket,there are this queue, [{item1},{item2},{item3},{item4},{item5},{item6},{item7}]
when i QueuePop() by foreach,it always get the same item ‘item1’ every time and meantime deleting item7,i don’t know why.i want get item1 and delete item or get item7 and delete item7