Webhook Message Status  Topic is solved

Discussions relating to the REST API of Jiwa 7.

Webhook Message Status

Postby SBarnes » Fri Jul 09, 2021 5:34 pm

What are the different statuses for web hook messages and what to they mean?

For a client we are somehow ending up with messages with status 1 in in web hook messages that seem to remain there and I believe it is because of


Code: Select all
            if (message.Status == 1)
                return;


which is at the top of

Code: Select all
static public void CallWebhook(SY_WebhookMessage message)
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: Webhook Message Status  Topic is solved

Postby Mike.Sheen » Fri Jul 09, 2021 6:44 pm

SBarnes wrote:What are the different statuses for web hook messages and what to they mean?


// 0 = not sent, never been tried
// 1 = successfully sent already
// 2 = failed to send, retry pending
// 3 = failed permanently

SBarnes wrote:For a client we are somehow ending up with messages with status 1 in in web hook messages that seem to remain there and I believe it is because of

Code: Select all
            if (message.Status == 1)
                return;


1 means it's been sent, so it should stay at 1. The message.Status == 1 check is an attempt to prevent a message being sent multiple times. We've re-jigged things a bit in the next release to make that more reliable, as we found short retry intervals could still cause them to be sent more than once.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: Webhook Message Status

Postby SBarnes » Fri Jul 09, 2021 6:54 pm

I think the issue is Azure SQL again and the insert into reply and update to message is blowing up and therefore it never gets to the code to remove the item from in memory messages, so we end up going round and round with a whole heap of status ones in the queue.

I've changed the code in CallWebhook to use my new retry and connection with greater timeouts for ORM Lite and added some more logging to get a better picture of what's going on.

If it works and remains stable with the retro fitted 7.3 stuff I'll email it through to you as well, so you are aware of what was issues, as I've said before this customer knows how to stress test it. :D
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to REST API

Who is online

Users browsing this forum: No registered users and 4 guests

cron