csantanapr opened a new issue #220: Feed Management Enhancements : READ and 
UPDATE lifecycleEvent
URL: https://github.com/apache/incubator-openwhisk-package-kafka/issues/220
 
 
    Feed Management Enhancements for Kafka feed
   
   This issue is an Epic to collect all the related tasks to implement the 
final solution for kafka
   
   For some background on feeds and lifecycles refer to 
https://github.com/apache/incubator-openwhisk/blob/master/docs/feeds.md
   
   This features are based on user feedback 
   
   # Feature Requests
   - Allow the user retrieve trigger information from the feed provider
     - This allows the user to get back the original config
     - This allows the user to get the current status of the trigger
   - Allow the user to update the trigger configuration on the feed provider 
without the need to delete and re-create the trigger with a new configuration
   
   ## Lifecycle Events
   Today this feed implements the lifecycle events `CREATE` and `DETELETE`
   To implement the features requested above the this feed would need to 
implement the lifecycle events `READ`, `UPDATE`
   
   ### READ lifecycle
   The feed action should accept the parameter `lifecycleEvent` with the value 
of `READ`.
   
   It should return the configuration and status for the trigger, for example:
   ```json
   {
     "config":{
       "triggerName": "_/myKafkaTrigger",
       "isMessageHub": true,
       "topic": "mytopic",
       "isJSONData": true,
       "isBinaryValue": false,
       "isBinaryKey": false,
       "brokers": [
         "kafka01-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka02-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka03-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka04-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka05-prod01.messagehub.services.us-south.bluemix.net:9093"
       ],
       "username": "admin",
       "password": "123",
       "kafka_admin_url": 
"https://kafka-admin-prod01.messagehub.services.us-south.bluemix.net:443";
     },
     "status":{
       "active": false,
       "dateChanged":1509321736699,
       "dateChangedISO":"2017-10-30T00:02:16.699Z",
       "reason":{
         "kind": "AUTO",
         "statusCode": 403,
         "message": "Automatically disabled after receiving a 403 status code 
when firing the trigger."
       }
     }
   }
   ```
   Notes:
   The field `status.reason` not present when `status.active` is `true`
   
   The clients would be able to invoke the feed action with this 
`lifecycleEvent`
   For example using the CLI directly invoking the feed action.
   ```
   wsk action invoke /whisk.system/messaging/messageHubFeed -p triggerName 
_/myKafkaTrigger -p authKey guest:123 -p lifecycleEvent READ -r
   ```
   
   The go-CLI would be able to call the feed action automatically on a `trigger 
get`.
   For example:
   ```
   wsk trigger get myKafkaTrigger
   ```
   ```
   ok: got trigger myCloudantTrigger
   {
       "namespace": "guest",
       "name": "myKafkaTrigger",
       "version": "0.0.1",
       "annotations": [
           {
               "key": "feed",
               "value": "/whisk.system/messaging/messageHubFeed"
           }
       ]
   }
   ok: invoked feed action /whisk.system/messaging/messageHubFeed
   {
     config:{
       triggerName: "_/myKafkaTrigger",
       isMessageHub: true,
       topic: "mytopic",
       isJSONData: true,
       isBinaryValue: false,
       isBinaryKey: false,
       brokers: [
         "kafka01-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka02-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka03-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka04-prod01.messagehub.services.us-south.bluemix.net:9093",
         "kafka05-prod01.messagehub.services.us-south.bluemix.net:9093"
       ],
       username: "admin",
       password: "123",
       "kafka_admin_url": 
"https://kafka-admin-prod01.messagehub.services.us-south.bluemix.net:443";
     },
     status:{
       active: true
       }
     }
   }
   ```
   
   #### UPDATE lifecycle
   The UPDATE lifecycle will allow users to update their feed without the need 
to delete and re-create their trigger.
   The feed action should accept the parameter `lifecycleEvent` with the value 
of `UPDATE`.
   
   The user should be able to pass a partial set of the configuration values, 
allowing them to update their trigger feed.
   
   The feed will be paused while it's being updated.
   For example if user wants to update the topic name, it will invoke the feed 
action with the `topic` parameter for the existing trigger.
   
   For example invoking directly the feed action:
   ```
   wsk action invoke /whisk.system/messaging/messageHubFeed -p topic newtopic 
-p triggerName _/myKafkaTrigger -p authKey guest:123 -p lifecycleEvent UPDATE -r
   ```
   
   Using the cli using the integration embedded into the CLI
   ```
   wsk trigger update myKafkaTrigger -p topic newtopic
   ```
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to