serverless / serverless-openwhisk

Adds Apache OpenWhisk support to the Serverless Framework!
http://openwhisk.org/
MIT License
143 stars 47 forks source link

Message Hub trigger doesn't fire #163

Closed pheuberger closed 5 years ago

pheuberger commented 5 years ago

I'm running serverless via IBM Cloud Functions. Here are the relevant parts from my serverless.yml file:

custom:
  org: MyOrg
  space: ${env:SPACE}
  mhServiceName: MyOrg-kafka

functions:
  main:
    handler: src/handler.main
    bind:
      - service:
          name: messagehub
          instance: ${self:custom.mhServiceName}
    events:
      - message_hub:
          package: /${self:custom.org}_${self:custom.space}/Bluemix_${self:custom.mhServiceName}_Credentials-1
          topic: sales

Running the deploy script it indeed creates a trigger for this topic. However the function is not invoked when messages are published to this topic. In turn, when I create a trigger through the IBM Cloud Console and connect it to my function it works.

I noticed, serverless creates a Custom Trigger whereas creating a trigger via the Cloud Console gives you a Message Hub trigger. Might this have something to do with it?

Screen Shot 2019-03-26 at 2 33 47 PM
jthomas commented 5 years ago

👋 @pheuberger

Using your configuration from above - I've managed set everything up and it works for me... which is less helpful for you :)

Can you include the status of the deployed triggers and rules? Here's what I get...

ibmcloud wsk trigger get mh-test_main_messagehub_testing
ok: got trigger mh-test_main_messagehub_testing
{
    "namespace": "Developer Advocacy_Developer Advocacy",
    "name": "mh-test_main_messagehub_testing",
    "version": "0.0.1",
    "limits": {},
    "publish": false,
    "rules": {
        "Developer Advocacy_Developer Advocacy/mh-test_main_messagehub_testing_rule": {
            "action": {
                "name": "mh-test-dev-main",
                "path": "Developer Advocacy_Developer Advocacy"
            },
            "status": "active"
        }
    }
}
ibmcloud wsk rule get mh-test_main_messagehub_testing_rule
ok: got rule mh-test_main_messagehub_testing_rule
{
    "namespace": "Developer Advocacy_Developer Advocacy",
    "name": "mh-test_main_messagehub_testing_rule",
    "version": "0.0.1",
    "status": "active",
    "trigger": {
        "name": "mh-test_main_messagehub_testing",
        "path": "Developer Advocacy_Developer Advocacy"
    },
    "action": {
        "name": "mh-test-dev-main",
        "path": "Developer Advocacy_Developer Advocacy"
    },
    "publish": false
}
jthomas commented 5 years ago

Closing due to lack of activity (unless you have anything new to add @pheuberger?)