Skip to content
This repository has been archived by the owner. It is now read-only.

Implement publishEvents resolver #12

Merged
merged 2 commits into from Jun 28, 2017

Conversation

Projects
None yet
2 participants
@c-w
Copy link
Member

commented Jun 27, 2017

This pull request implements the publishEvents resolver in MessageSchema mentioned in project-fortis-spark#17 which is the same as the client-piece mentioned in project-fortis-spark#30

The implementation is straight forward:

  1. A user uploads a file with custom events via the project-fortis-interfaces frontend
  2. The frontend calls the publishEvents mutation
  3. A resolvers puts the events onto an EventHub
  4. From here, the project-fortis-spark will pick up the events and push them through the analysis pipeline

I've also set up a test EventHub for everyone to play around with the implementation. Use the following environment settings:

PUBLISH_EVENTS_EVENTHUB_CONNECTION_STRING='...from azure dashboard...'
PUBLISH_EVENTS_EVENTHUB_PATH='customevents'
PUBLISH_EVENTS_EVENTHUB_PARTITION='$Default'

Sample mutation for graphiql.

mutation {
  publishEvents(input:{messages:[
    {RowKey:"a",created_at:"now",message:"message",language:"llcc",
     featureCollection:{type:"bla",features:[
      {type:"foo", coordinates:[1, 2, 3]}
    ]}},
    {RowKey:"b",created_at:"now",message:"message",language:"llcc",
     featureCollection:{type:"bla",features:[
      {type:"foo", coordinates:[1, 2, 3]}
    ]}},
    {RowKey:"c",created_at:"now",message:"message",language:"llcc",
     featureCollection:{type:"bla",features:[
      {type:"foo", coordinates:[1, 2, 3]}
    ]}}
  ]})
}

Here you can see messages being sent to the EventHub from GraphQL:

image

@c-w c-w requested a review from erikschlegel Jun 27, 2017

@erikschlegel
Copy link
Collaborator

left a comment

LGTM

@c-w c-w merged commit 91d1670 into master Jun 28, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@c-w c-w deleted the publish-events-resolver branch Jun 28, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.