Send automated push notifications in the same time using urbanairship - urbanairship.com

I want to send every day in the same time push notification using urbanairship.
How can I do it?

here what does 'same time' actually reflects..a regular synchronous time on clock or delta asynchronous time?

Related

How do we maintain consistent read promise to clients when using a fallback queue?

In my company, we are using Event Sourcing pattern to implement a storage for all changes to the price of a booking. Across the company, different services might try to append events to a booking identified by a booking code.
We use DynamoDB to store the event and it does support consistent read. The thing is in the case when a booking is initially made and the very 1st event is created for a booking code, if we fail to save into DynamoDB for whatever reasons, we put the event into a fallback queue and simply return a success to the client to acknowledge that we already received the event. Client can then move on with their business logic flow and in turn, show a success message to end users. The goal is to not block booking creation at all costs.
The problem is, for a very short period of time, when the event is still in the fallback queue, if clients try to fetch the event using the booking code, they will get back an error although we told them that the write on the 1st event was a success earlier. In a way, we're breaking the consistent read promise here.
I'm trying to find a way where we can improve the design and keep this promise while remaining out of the way of the main booking flow (i.e. not blocking the booking on failure).
I'd be very grateful if someone could throw me an idea to look into.
One solution might be to have the fallback queue be durable (i.e. reading from it doesn't remove elements from the queue) up to some retention period (broadly: the maximum allowable time between initial booking and persisting the creation event to DynamoDB) and instead of being a fallback queue be the actual source of truth for which bookings have been created.
Services can then consume this queue: one of these services is responsible for writing the initial creation event to DynamoDB (which is longer-lived than the queue). If that service is falling behind and approaching the retention limit, that's an operational emergency, but you're buying yourself time. Another of these services maintains an in-memory view based on the queue of created bookings which haven't yet made it to Dynamo.

How to view total triggered run-time today

I am writing code which is running on triggers. I know that I have 1 hour of triggered run time per day. Can I access how much of this hour I have used? Or can I log how much I used at the end of the day so I can know if I am in danger of going over this quota?
Thank you,
Eric
Now you can make use of Apps Script REST API to achieve this. Specifically, the REST Resource: processes one.
Please refer to the duration field as displayed here -

Updating HTML interface from Server Script

I have written a standard google web app script with server code and a html interface. The web interface prompts the user for a month and year then creates a google document (by copying a template document) for every day in the month selected.
I have got the code working but I would like to provide some sort of status as the code is running. It takes about 4 mins. I put out a message before calling the server code and a message when it completes but I would like to provide progress updates. i.e. "Docs Created 1", "Docs created 2" etc.
I guess what I am really asking is can google server code update something on the web page while it is running?
Thanks.
Will
No, it cannot (AFAIK).
But since it is taking 4 minutes (which is dangerously close to the 6 minute limit), I suggest you create only one document on your function, then return to the client-side. The client-side will then update the status on the screen and call your server-side function again, which will do the second document, return and so on, until you finish.
By doing this you not only updates your client-side but also avoid getting close to the maximum execution limit. The downside, of course, is that you'll add up some seconds to your total execution time. But for long tasks I don't much problem, actually informing the user of your script progress will make it feel faster in comparison.

Why is queue to queue transfer not supported in MQFTE Monitors

Why is queue to queue transfer not supported in MQFTE Monitors ? I have set an monitor for a queue and when any message is dropped in the queue , a transfer from queue to queue must be triggered. But MQFTE doesnt have this option. Is there any other alternative ?
I can't really answer the questions as written - i.e. "why" it works the way it does. I can only speculate that because FTE is written to move files there are file name metadata and semantics in the queue-to-file and file-to-queue that don't make sense in queue-to-queue.
What you can do though is write up your use case in detail and submit a formal requirement. Then at least you have a chance to see that functionality in a future release.
In the meantime what you are doing sounds like a job for triggering. WMQ has the ability to fire an external process on the arrival of a message. Given your requirements, I'd trigger an ANT job to initiate the transfer when the message arrives on the queue. If the queue-to-queue transfer needs to be recorded in the FTE logs then the processing flow would be something like this:
Message arrives on the queue
Trigger monitor starts job
Job browses message on the queue
Job passes message ID to an ANT task
ANT task moves files.
A pre- or post- transfer task uses SupportPac MA01 to move the message in the queue based on MsgID.
Triggered program loops over any messages in the queue and initiates a separate ANT task for each until the queue is empty.
If the queue-to-queue transfer doesn't need to be recorded in the FTE logs, the flow would be similar except that the triggered job would consume the message and move it straight away instead of passing it to the ANT task.

How can I delay mail delivery through an SMTP relay, possibly sendmail

I have a requirement to delay mail delivery through an SMTP Relay.
i.e.
Mail message is successfully recieved at time T.
Forward Message to destination at time T+4hours.
Is this possible in sendmail or any other SMTP Relay.
Deployment platform is IBM AIX.
You should've been at least a little more specific in your question. I'll just throw in some suggestions anyway.
If you just want to deliver mail every four hours, you have to run sendmail in queue-only mode (QUEUE_MODE="cron"; in sendmail.conf) and set up the queue to be run every four hours (QUEUE_INTERVAL="4h";). I think, this only applies to debian-like systems, but the principle is the same anywhere - you set the queue mode to cron (this is actually controlled by the arguments, with which you start sendmail) and then you process it periodically.
If you want to just delay mail delivery, there is also a number of ways to do it, depending on why you want to do it. One popular solution is greylisting, it does just the following - when a host connects to your MTA (sendmail, f.ex.), it gets bounced with the prompt to try again in some time interval. A properly configured mailer will just do that - it will try sending the mail again and eventually the message will be accepted and delivered (or forwarded). Most of the spam bots, on the other hand, will not try to resend the message upon receiving an error. If you need greylisting on sendmail you can read up here: http://www.greylisting.org/implementations/sendmail.shtml
Hope this helped at least a bit.
EDIT:
Ok, so now I see what you need doing. Here is the possible solution using sendmail (I've been dealing with sendmail in one way or another for years now, so.. :P): You use two of them.
The first one just receives mail and queues it and (and it is important) it does NOT get to process the queue. The second sendmail instance runs a separate queue and its QUEUE_MODE is set to daemon or cron (say, every minute). Now all you need is to write an external script, that would move the mail from the first queue to the second, once the "age" of the message is reached. Since queue items are just files, it is an easy task, done in a few lines of, say, perl (hell, a shell script can do that, too). Moving queue items from queue to queue is as easy as moving files from directory to directory. Please note, that this technique is widely used in mail processing solutions, such as, say spamassassin, so its not some weirdness, conjured by my deseased mind :P
Hope this gives you a hint or two.