Skip to content
Snippets Groups Projects
Commit b4c063fd authored by Komal Makkar's avatar Komal Makkar
Browse files

adding sop for topic creation.

parent 75472600
No related branches found
No related tags found
1 merge request!62Adding playbook for Topic Creation and Consumption
Pipeline #27758 failed
# SOPs for Creating a new Topic and Adding subscriber for it.
__Contents__
1. [Introduction](#Introduction)
2. [Create Event Grid Topic.](#Create Event Grid Topic)
3. [Make partition service aware of the new topic](#Make partition service aware of the new topic)
4. [Publish to Event Grid Topic](#Publish to Event Grid Topic)
5. [Steps to Subscribe](#Steps to Subscribe)
6. [FAQs](#FAQs)
#### Introduction
Notification service is invoked by PubSub called [Event Grid](https://docs.microsoft.com/en-us/azure/event-grid/).
#### Create Event Grid Topic.
1. Create a Topic. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/blob/master/infra/templates/osdu-r3-mvp/data_partition/main.tf#L301)
2. Assign the Service Principals of the service the role of subscription contributor. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/32)
3. Create secrets in Common Resources Key Vault that helps your service identify the event grid topic end point. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/30/diffs)
Make sure you name them in the fashion "eventgrid-<nameoftopic>topic" and "eventgrid-<nameoftopic>topic-accesskey"
#### Make partition service aware of the new topic.
For all the tenants, add the new topic information. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/101)
#### Publish to Event Grid Topic.
Use the Event Grid Store to publish the message. [Reference](https://community.opengroup.org/osdu/platform/system/storage/-/blob/master/provider/storage-azure/src/main/java/org/opengroup/osdu/storage/provider/azure/MessageBusImpl.java#L67)
#### Steps to Subscribe
1. Register your subscriber with Register Service. You will need to expose two endpoints
__Get Endpoint__: for a Handshake/challenge response. [Reference](https://community.opengroup.org/osdu/platform/system/register/-/blob/master/register-core/src/main/java/org/opengroup/osdu/register/api/test/SubscriberListenerApi.java#L52)
__Post Endpoint__: for receiving notifications. [Reference](https://community.opengroup.org/osdu/platform/system/register/-/blob/master/register-core/src/main/java/org/opengroup/osdu/register/api/test/SubscriberListenerApi.java#L65)
2. Initiate a handshake for each tenant, to register service. Which means for onboarding a service, you have to initiate a handshake, per data partition.
3. Whitelist the endpoints from Istio. Make sure you are not calling entitlements service for the same.
#### FAQs
1. __Event Grid is push endpoint. I have need for a pull mechanism, how can I achieve it?__
Notification service is not equiped for pull mechanism yet. You can publish to pull based products like Service Bus.
In case you want both pull and push subscribers, notification service can be an interface for only push (Event Grid).
A subscriber to that Event Grid Topic could be a Service Bus Topic. This Service Bus Topic in turn can have multiple
pull subscribers. [Reference](https://community.opengroup.org/osdu/platform/deployment-and-operations/infra-azure-provisioning/-/merge_requests/97/diffs)
2. __Does notification service provide filter?__
Not today.
3. __When should I create a topic vs using an existing one?__
IF the nature of messages and subscribers overlap completely with an existing topic, re-use it.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment