I have written a queueTrigger - Azure functions
def main(msg: func.QueueMessage) -> None:
logging.info('Python queue trigger function processed a queue item: %s',
msg.get_body().decode('utf-8'))
mk_client = MyKiosk()
storage = StorageAccount(os.environ["AzureWebJobsStorage"])
data = mk_client.get_allgroupdata()
for i in data:
main_id = i["HauptgruppeId"]
for j in i["Untergruppe"]:
sub_id = j["UntergruppeId"]
outbound_msg = {"mainid_val": main_id,"subid_val": sub_id,"n_records": 12}
<code to remove duplicates>
storage.write_queue_message("pricequeue", json.dumps(outbound_msg))
This is my QueueTrigger script and I want to make sure there are no duplicates in 'outbound_msg' and unique messages can be written in the 'pricequeue'
You can remove the duplicates from queue trigger python script by using Popleft or collections dequeue
Below is the example script for using
popleftAlso here are few other links which will give you complete information about removing duplicates and which are having related discussions.