Create a serverless, event-driven application with Apache OpenWhisk on IBM Cloud Functions that executes code in response to messages or to handle streams of data records from Apache Kafka or IBM Message Hub.
package:
name: data-processing-message-hub
namespace: _
triggers:
# Creating the kafka-trigger trigger"
kafka-trigger:
source: $KAFKA_MESSAGE_HUB_FEED
inputs:
isJSONData: true
topic: $SRC_TOPIC
actions:
# Action named "mhget-action"
# Creating action as a regular Node.js action
mhget-action:
location: actions/mhget/mhget.js
# Action named "mhpost-action"
# Creating action as a zipped Node.js action, as it contains dependencies
mhpost-action:
location: actions/mhpost/mhpost.zip
runtime: nodejs:6
inputs:
api_key: $API_KEY
kafka_rest_url: $KAFKA_REST_URL
topic: $DEST_TOPIC
sequences:
# Sequence named "kafka-sequence"
# Creating the sequence that links the get and post actions
kafka-sequence:
actions: mhget-action, mhpost-action
rules:
# Sequence named "kafka-inbound-rule"
# Creating the rule that links the trigger to the sequence
kafka-inbound-rule:
trigger: kafka-trigger
action: kafka-sequence
Dropping package "kafka" and package binding "kafka-out-binding". Moving mhpost-action out of kafka package. Here is the new structure:
As a result of this movement, I had to add command line parameters to mhpost-action which were originally part of "kafka-out-binding".
I have the manifest file created with this new structure but deployment using that manifest doesn't work for two reasons: