How to write a TeamCity notification plugin which will execute with no subscribed users
I'm trying to write a plugin to handle notifications via a third party app which runs on iOS, Android and Windows phones. The app itself handles the user subscriptions, TeamCity does not [need to] handle the subscriptions.
The TeamCity plugin docs say:
- Notifications are only delivered if there is at least one subscribed user for given event.
The api has methods which include a collection of subscribed users:
- public void notifyBuildSuccessful(SRunningBuild sRunningBuild, Set sUsers);
How can I get TeamCity to call my notification plugin even though there will be no users registering as plugin subscribers through TeamCity itself?
Please sign in to leave a comment.
This is the answer I received to the same question on stacxkoverflow:
There are two ways to approach custom notifications in TeamCity:
The first approach is described in TeamCity documentation which you refer to.
The second one is to register for all server events and process them as you like. WebHooks plugin has anexample of the approach. A related note: If processing an even can take time, I'd recommend to do that asynchronously in order not to stall the server by slow server events processing.