Handling error while receiving message from queue

awinavawinav Member Posts: 8
Hi all,

my NAS (3.6) is set up to receive message from a queue, and creates a record in a table based on the message information. This has been working very nicely for months.

Unfortunately my NAS crashes now and then because of an unknown reason. And if it crashes while receiving a message from the queue and creating the new record, the record is not inserted, but the message from the queue is already received and deleted. I can reproduce the same behaviour if I put ERROR('') somewhere in the CC2:MessageReceived(VAR InMessage ...) function.

Do you guys have any idea how to handle such a situation? For example, the Navision Timer has an error handling function objTimer::TimerError(ErrorString...) which can handle errors while processing the Timer event. Or is it the only way to have the message submitter double check the result?

I will appreciate any ideas and thoughts. Thanks!

Comments

  • ara3nara3n Member Posts: 9,256
    a couple of suggestion.

    Get the latest Nav DLL files and use those automations instead.

    OnMessageReceived write the the xml file into a staging table first and COMMIT

    then run your code.

    In your code you will look for any any entries that exists in the staging table and process them. and then delete them and commit.

    Add a status field in the staging field if you want to skip the ones that error out.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.