Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. We get a Subscription Create Request with unique subscription-id and a list of predicates(list of targets , datastore and list of filters)

    Code Block
    titleSubscription Create Request
    {
    "subscriptionId" : "A-10",
    "predicates" : [
      {
    	"targets": [ch-1,ch-2],
        "datastore" : "ncmp-datastore:passthrough-operational",
    	"datastore-xpath-filter" : ["p1/c1","p2/c2"]
    	},
      {	"targets": [ch-3],
        "datastore" : "ncmp-datastore:passthrough-operational",
    	"datastore-xpath-filter" : ["p3/c3"]
    	}
    ]
    
    }



  2. We persist the incoming request as is in our persistent store using a relevant subscription model ( this model also needs to be revised )
  3. We also maintain a distributed datastructure in Hazelcast to keep track of the request and response to the client.

    SubscriptionIddmi-pluginaffectedCmHandlesstatus
    A-10dmi-1["ch-1","ch-2"]PENDING
    A-10dmi-2["ch-3"]PENDING



  4. Read the requests from the distributed data structure and form the request for the DMI-Plugin and publish it to the internal kafka channel.
  5. If the DMI-Plugin responds back within the configured time , so the request will either be ACCEPTED or REJECTED.
    1. if whole subscription request is ACCEPTED , update the distributed data structure and then store the subscription to the ActiveSubscriptions in cps-cache.
    2. if whole subscription request is REJECTED , update the distributed data structure and send back the response to the client.
    3. if the DMI Plugin fails to respond then the status would remain PENDING only as there is no change.


      SubscriptionIddmi-pluginaffectedCmHandlesstatus
      A-10dmi-1["ch-1","ch-2"]ACCEPTED
      A-10dmi-2["ch-3"]REJECTED



  6. We store the "ActiveSubscriptions" using a new model which will look like below.

    SubscriptionIdcmHandlefilterdatastore
    A-10ch-1p1/c1ncmp-datastore:passthrough-operational
    A-10ch-1p2/c2ncmp-datastore:passthrough-operational
    A-10ch-2p1/c1ncmp-datastore:passthrough-operational
    A-10ch-2p2/c2ncmp-datastore:passthrough-operational



  7. Now based on whatever we have in the distributed map , we will send the response to the clients and may be clear the in-memory structure if required.

Merging ( in-progress )


  1. We get a new subscription create request.

    Code Block
    {
    "subscriptionId" : "B-52",
    "predicates" : [
      {
    	"targets": [ch-2],
        "datastore" : "ncmp-datastore:passthrough-operational",
    	"datastore-xpath-filter" : ["p2/c2" , "p3/c3"]
    	}
    ]
    
    }


  2. We now look at the "ActiveSubscriptions"  if we already have an active subscription either for a combination of "cmhandle and xpath filter and the datastore".

    Current view of ActiveSubscriptions

    SubscriptionIdcmHandlefilterdatastore
    A-10ch-1p1/c1ncmp-datastore:passthrough-operational
    A-10ch-1p2/c2ncmp-datastore:passthrough-operational
    A-10ch-2p1/c1ncmp-datastore:passthrough-operational
    A-10ch-2p2/c2ncmp-datastore:passthrough-operational


    Check if we have ch-2 , p2/c2 and ncmp-datastore:passthrough-operational then directly add to the ActiveSubscription.
    Similarly check for ch-3 , p3/c3 and ncmp-datastore:passthrough-operational ( which in this case will not be directly to the active subscription)

  3. Now the state of ActiveSubscription is :

    SubscriptionIdcmHandlefilterdatastore
    A-10ch-1p1/c1ncmp-datastore:passthrough-operational
    A-10ch-1p2/c2ncmp-datastore:passthrough-operational
    A-10ch-2p1/c1ncmp-datastore:passthrough-operational
    A-10ch-2p2/c2ncmp-datastore:passthrough-operational
    B-52ch-2p2/c2ncmp-datastore:passthrough-operational


    and state of the in-memory datastructure is as follows.

    SubscriptionIddmi-pluginaffectedCmHandlesstatus
    B-52dmi-1["ch-2"]PENDING



...