Open johnlim opened 6 years ago
I believe this is associated with issue #501 . I am encountering events not being emitted only after experiencing issue #501. I have experienced it across different apps, services and tenants but as I wasn't specifically trying to reproduce it, didn't document how to duplicate it. I'll update this issue if I can re-duplicate the issue.
To duplicate this issue 1) Continuing off from issue #501, duplicate but rename the createUser function in handler.js and update serverless.yml as follows
createUserDuplicate:
handler: handler.createUserDuplicate
events:
- eventgateway:
type: sync
eventType: http.request
path: /usersduplicate
method: POST
2) run sls deploy
3) do
curl -X POST -H "Content-Type: application/json" https://${APP}/usersduplicate --data '{ "id": "10", "firstName": "Donald", "lastName": "Duck", "email": "donalds.duckied@disney.com" }'
4) run sls logs --function emailUser
. It shows event received
Received user.created event with user:
{ email: 'donalds.duckied@disney.com',
firstName: 'Donald',
id: '10',
lastName: 'Duck' }
5) run sls remove
6) run sls deploy
7) run
curl -X POST -H "Content-Type: application/json" https://${APP)/usersduplicate --data '{ "id": "10", "firstName": "Donald", "lastName": "Duck", "email": "donalds.duck@disney.com" }'
8) run sls logs --function createUserDuplicate
. It'll show Emitted user.created event
8) run sls logs --function emailUser
. It'll show No existing streams for the function
Hey @johnlim, thanks for raising.
Can you add the configuration for the function that's subscribed to the user.created
event? That should help with debugging.
Hi @alexdebrie, thanks for responding.
I'm basing the code from https://github.com/serverless/event-gateway-getting-started, therefore the configuration that subscribed to the user.created
event is as follows:
emailUser:
handler: handler.emailUser
events:
- eventgateway:
type: async
eventType: user.created
I just double-checked the dashboard and realised event-gateway actually fired the event but the subscriber was not triggered in this particular instance.
This is a Bug Report
Running this code snippet
resulted in the console log
Emitted user.created event
being captured but the event was not emitted. I know that the event was not emitted because it wasn't captured in the Event Gateway logs (i.e from the Dashboard) and the subscriber function wasn't triggered.While deploying the console shows that the events were correctly set up as follows: