Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support kafka events for schedule events create/update/delete operations #12970

Open
wants to merge 2 commits into
base: Ursa-21.3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/**
* @package deployment
*/
require_once (__DIR__ . '/../../bootstrap.php');

$script = realpath(dirname(__FILE__) . '/../../../') . '/tests/standAloneClient/exec.php';
$scheduleEventNotificationUpdate = realpath(dirname(__FILE__) . "/../../updates/scripts/xml/notifications/2024_12_12_add_kafka_schedule_event_events.xml");


if(!file_exists($scheduleEventNotificationUpdate))
{
KalturaLog::err("Missing update script file");
return;
}

passthru("php $script $scheduleEventNotificationUpdate");
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<xml>
<config>
<serviceUrl>@SERVICE_URL@</serviceUrl>
<partnerId>-2</partnerId>
<clientTag>Stand alone php 1.0.0</clientTag>
<curlTimeout>30</curlTimeout>
<userAgent>Stand alone php 1.0.0</userAgent>
</config>
<session>
<partnerId>-2</partnerId>
<secret>@ADMIN_CONSOLE_PARTNER_ADMIN_SECRET@</secret>
<sessionType>2</sessionType>
</session>

<multirequest>
<request service="eventNotificationTemplate" action="add" plugin="eventNotification" partnerId="0">
<template objectType="KalturaKafkaNotificationTemplate">
<name>Schedule Event Created</name>
<systemName>KAFKA_SCHEDULE_EVENT_CREATED</systemName>
<description>Kafka notification template to be sent when a new schedule event is created</description>
<automaticDispatchEnabled>1</automaticDispatchEnabled>
<eventType>5</eventType>
<!-- EventNotificationEventType::OBJECT_CREATED -->
<eventObjectType>scheduleEventNotifications.ScheduleEvent</eventObjectType>
<!-- EventNotificationEventObjectType::ScheduleEvent -->
<topicName>schedule_event</topicName>
<partitionKey>id</partitionKey>
<messageFormat>1</messageFormat>
<apiObjectType>KalturaScheduleEvent</apiObjectType>
</template>
</request>
<request service="eventNotificationTemplate" action="updateStatus" plugin="eventNotification" partnerId="0">
<id>{1:result:id}</id>
<status>1</status>
<!-- EventNotificationTemplateStatus::DISABLED -->
</request>

<request service="eventNotificationTemplate" action="add" plugin="eventNotification" partnerId="0">
<template objectType="KalturaKafkaNotificationTemplate">
<name>Schedule Event Updated</name>
<systemName>KAFKA_SCHEDULE_EVENT_UPDATED</systemName>
<description>Kafka notification template to be sent when a new schedule event is updated</description>
<automaticDispatchEnabled>1</automaticDispatchEnabled>
<eventType>3</eventType>
<!-- EventNotificationEventType::OBJECT_CHANGED -->
<eventObjectType>scheduleEventNotifications.ScheduleEvent</eventObjectType>
<!-- EventNotificationEventObjectType::ScheduleEvent -->
<topicName>schedule_event</topicName>
<partitionKey>id</partitionKey>
<messageFormat>1</messageFormat>
<apiObjectType>KalturaScheduleEvent</apiObjectType>
</template>
</request>
<request service="eventNotificationTemplate" action="updateStatus" plugin="eventNotification" partnerId="0">
<id>{3:result:id}</id>
<status>1</status>
<!-- EventNotificationTemplateStatus::DISABLED -->
</request>

<request service="eventNotificationTemplate" action="add" plugin="eventNotification" partnerId="0">
<template objectType="KalturaKafkaNotificationTemplate">
<name>Schedule Event Deleted</name>
<systemName>KAFKA_SCHEDULE_EVENT_DELETED</systemName>
<description>Kafka notification template to be sent when a new schedule event is deleted</description>
<automaticDispatchEnabled>1</automaticDispatchEnabled>
<eventType>7</eventType>
<!-- EventNotificationEventType::OBJECT_DELETED -->
<eventObjectType>scheduleEventNotifications.ScheduleEvent</eventObjectType>
<!-- EventNotificationEventObjectType::ScheduleEvent -->
<topicName>schedule_event</topicName>
<partitionKey>id</partitionKey>
<messageFormat>1</messageFormat>
<apiObjectType>KalturaScheduleEvent</apiObjectType>
</template>
</request>
<request service="eventNotificationTemplate" action="updateStatus" plugin="eventNotification" partnerId="0">
<id>{5:result:id}</id>
<status>1</status>
<!-- EventNotificationTemplateStatus::DISABLED -->
</request>
</multirequest>

</xml>
15 changes: 15 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Ursa-21.3.0

## Add kafka event notification for schedule event create/update/delete ##
- Issue Type: Task
- Issue ID: FOUN-1370

### Configuration ###
Replace all tokens (SERVICE_URL, ADMIN_CONSOLE_PARTNER_ADMIN_SECRET) from the template XML file below and remove ".template" from the file name:
/opt/kaltura/app/deployment/updates/scripts/xml/notifications/2024_12_12_add_kafka_schedule_event_events.template.xml

Add the follwing plugin to your plugins.ini file:
ScheduleEventNotifications

### Deployment scripts ###
php /opt/kaltura/app/deployment/updates/scripts/2024_12_12_add_schedule_event_events.php

## Enable embed & social stream in EP ##
* Issue Type: Task
* Issue ID: PLAT-24999
Expand Down