When is a PubSub Subscription considered to be inactive? - google-cloud-pubsub

As per Google Cloud documentation:
By default, subscriptions expire after 31 days of inactivity (for instance, if there are no active connections, pull requests, or push successes). If Pub/Sub detects subscriber activity, the subscription deletion clock restarts. Using subscription expiration policies, you can configure the inactivity duration or make the subscription persistent regardless of activity. You can also delete a subscription manually.
Is subscription considered to be inactive even if there are unacked messages on it?

In addition to the documentation you shared, I would like you to pay attention in the following statement, taken from another part part of the documentation,
An unacknowledged message is retained in a subscription for up to message_retention_duration after it is published (the default is 7 days).
Therefore, after publishing the messages to the Subscriber, these messages will be retained for 7 days (default), and the deletion clock will start. If there are no more calls to the subscription the deletion clock will continue counting towards the expiration time because there won't be any activity in the subscription. Also, note that after 7 days these unacknowledged messages will be deleted.

Yes, a subscription is considered inactive if there is no subscriber activity on it, even if there are unacknowledged messages available to that subscription.
Subscription expiration is a configurable subscription property as described here.

Related

SubscriptionCountReached' has reached limit of '1000'

I am setting up subscriptions to M365 mailboxes so I can receive a change notification event when something happens to that mailbox. This has been working fine until recently when I started receiving this error:
Status Code: 429; Reason: Resource 'SubscriptionCountReached' has reached limit of '1000'. Please retry after '12/31/9999 11:59:59 PM
Ideally, I just want to delete all subscriptions setup on my M365 tenant, but cannot find where these exist in the Portal UI.
Does anyone have any ideas on how to clear out the old subscriptions that seem to be hanging around?
Status Code: 429;
Reason: Resource 'SubscriptionCountReached' has reached limit of '1000'. Please retry after '12/31/9999 11:59:59 PM
The above error usually occurs when you reach the maximum quota of times(1000) that are predetermined.
According to this Microsoft Doc, the maximum subscription quota for Azure AD resources are as follow:
To delete all the subscriptions set up in your M365 tenant, try steps mentioned in below link:
Delete subscriptions of Azure AD tenant - Azure Active Directory | Microsoft Docs
To allow deletion, subscriptions must be in Deprovisioned state.
An Expired or Canceled subscription will initially move to the Disabled state, and the final stage is the Deprovisioned state.
The simple way to cancel your subscription is to turn off recurring billing option in order to prevent other charges.
If you added your own domain name to use with your subscription, you must remove the domain before cancelling subscription.
The expired subscription will send several notifications. It can be deleted automatically after 90 days and will be deleted no later than 180 days.
For more in detail, please find below links if they are helpful.
References:
azure - Microsoft Graph. Exception : reached limit of '1000' - Stack Overflow
Cancel your subscription | Microsoft Docs
Delete expired subscription - Microsoft Community

What is the maximum count of Webhook subscrption for Microsoft Graph API?

I'm looking at the Create Subscription API documentation.
I would like to understand how many subscribers can I register for an app. Our system has 2000+ users and we are looking to set up a webhook subscription per user.
This is documented
https://learn.microsoft.com/en-us/graph/webhooks
Maximum subscription quotas:
Per app: 50,000 total subscriptions
Per tenant: 35 total subscriptions across all apps
Per app and tenant combination: 7 total subscriptions
The limits depend on the type of resources you are subscribing to.
For example, if you are subscribing to /users or /groups, then there are limits documented here.
Note that you would likely need a single subscription per tenant to track changes to all users/groups.
If you are subscribing to /messages, then you can create a subscription for each user mailbox.

How to schedule repeated jobs or tasks from user parameters in Google App Engine?

I'm using Google App Engine and I want like to be able to schedule jobs based users' parameters.
I know this can be done with cron jobs, but looks like it does not allow any flexibility from the user's point of view, but it allows only to schedule predefined jobs.
For example, suppose I have a news app where users can subscribe to different topics: I want the admin to be able to decide when to send a summary email, for instance, every day at 8am, and I want him to be able to edit this.
Is there anything that provides this?
You may want to star Issue 3638: Cron jobs to be scheduled programatically
Meanwhile you can write your own implementation: have a generic cron job running periodically (every 1 minute being the finest resolution) and inside that cron job check user-programmed scheduling data persisted somewhere (in the datastore for example) and, if needed, trigger execution of whatever is needed to be executed, either inlined or by enqueueing a task in some task queue.
It's possible to drive the scheduling resolution even under 1 minute, if needed, see High frequency data refresh with Google App Engine
For my debts tracking app DebtsTracker.io I've implemented it manually.
When a user creates a debt record he can specify due date that is stored in an unindexed DueDate and indexed ReminderDateTime fields.
I have a cron that query records with ReminderDateTime < today and sends notifications. Once notification sent the ReminderDateTime is set to null or far future so it's not picked in next cron run. If user hits Remind me again I am updating the ReminderDateTime to some date in future (user decides when).
If ReminderDateTime is closer then cron interval then I simply create I put a task to queue with appropriate delay.
This works very well and is very cheap to run.

How get monthly alerts of payments process of monthly subscriptions on Authorize.net?

I am using ARB method of authorize.net for monthly subscription. I am getting successful response on sandbox account.
How can I get alert on monthly bases when authorize.net perform next month payment deduction for subscription, so I can maintain record in database for the payments of any user monthly subscription?
If you want of be notified of subscription payments you can do one of two things:
Use Silent Post. Authorize.Net can send a POST request with payment data for all successful subscription payments to a URL that you specify. The data contained here will be identical to the response from a request made via their AIM API. Keep in mind that this only supports successful transactions. If a transaction fails you will not be notified.
Use Webhooks. A webhook is a notification that something happened. You can subscribe to webhook notifications that you care about, in your case anything related to subscriptions, and ignore ones that you don't. You do need to take an extra step as the webhook notification won't include much detail about the transaction so you will then need to query their API to get the transaction results, but it will notify you of all subscription payments including when one is declined, a subscription is suspended, or a subscription is expiring.

How to get a trigger when a Google app is deleted by a domain

This query is related to Google Apps. Is there a way we can get a trigger or a callback or force the user to visit a page from my app when user deletes my app from his domain?
I want to perform some operations when a user deletes the app from his domain.
Please help.
No. Mappings are completely independent of the app - they just 'point' at it. You can't get notifications when a user adds or deletes them.
The license notifications API allows you to retrieve a list of license-related events that have occurred for customers of your application. These events may be of four types:
provisions — A new license of the application has been provisioned.
expiries — A license of the application has expired.
deletions — An application has been deleted from a domain.
reassignments — An administrator has assigned or revoked a seat license for the application on the provided domain.
The license notification API allows several optional parameters:
timestamp — The time, measured in milliseconds since the UNIX epoch, to begin querying for notifications. The API will return results that occurred approximately after this time, but occasionally may return results that occurred prior to the timestamp. If you must have a list of notifications that only contains results after the timestamp, it is recommended that you apply a second filter in your code. The timestamp may not be used simultaneously with a start-token.
start-token — A continuation token, returned from a previous query, that may be used to continue retrieving notifications after the previous result set stopped. The start-token may not be used simultaneously with a timestamp.
max-results — The maximum number of notifications to return.
For a complete description of all response fields and possible values for those fields, see the reference.
For more : http://code.google.com/googleapps/marketplace/v2/developers_guide.html#license_notifications

Resources