unable to get the item added in the queue from rest service
Posted: Tue Aug 30, 2022 5:45 pm
Hi,
I created an endpoint to get inventory from 3rd party app in the custom REST route. I created one concurrent queue in ProcessInventory class and from endpoint I am adding items in it. On the other hand in ProcessInventory I created a while loop to process the inventory when ever its get item in the queue.
The problem is that the items are adding in the queue but when I try to dequeue item from queue in the while loop the queue does not contain that item in it and shows as empty. I putted the gethashcode of queue when enqueue and dequeue and got different hash code. I am not getting why its showing different hash code for the same queue object.
I putted the plugin code as well in the attachments
I created an endpoint to get inventory from 3rd party app in the custom REST route. I created one concurrent queue in ProcessInventory class and from endpoint I am adding items in it. On the other hand in ProcessInventory I created a while loop to process the inventory when ever its get item in the queue.
The problem is that the items are adding in the queue but when I try to dequeue item from queue in the while loop the queue does not contain that item in it and shows as empty. I putted the gethashcode of queue when enqueue and dequeue and got different hash code. I am not getting why its showing different hash code for the same queue object.
I putted the plugin code as well in the attachments