Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Implement publishEvents resolver #12

Merged
merged 2 commits into from
Jun 28, 2017
Merged

Implement publishEvents resolver #12

merged 2 commits into from
Jun 28, 2017

Conversation

c-w
Copy link
Contributor

@c-w c-w 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 June 27, 2017 18:27
Copy link
Collaborator

@erikschlegel erikschlegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@c-w c-w merged commit 91d1670 into master Jun 28, 2017
@c-w c-w deleted the publish-events-resolver branch June 28, 2017 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants