-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Pull Request for Issue #7 #8 ( Bryan + Minja) #9
Conversation
@huangmj7 Please run this updated PR again on your computer. |
@Bad-Science @huangmj7 I'm confident I resolved issues #7 & #8. However, I need to format the JSON message. The EventStream class is temporarily printing data to the command line. Right now, I'm making sure to write the data to the websocket.
|
Hi @Bad-Science, @huangmj7 pointed out that we can have one method within our Plezi class read-in data from the Kafka Consumer class and use the build in Plezi Method |
app/consumers/courses_consumer.rb
Outdated
|
||
class CourseConsumer < ApplicationConsumer | ||
def consume | ||
if ( Object.const_defined?('EventStream') == false ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this check needed?
app/consumers/sections_consumer.rb
Outdated
puts params #print out the single message received | ||
end | ||
def consume | ||
if ( Object.const_defined?('EventStream') == false ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, not sure why we need this check
app/consumers/sections_consumer.rb
Outdated
if ( Object.const_defined?('EventStream') == false ) | ||
puts "EventStream class not initialized" | ||
else | ||
EventStream.on_message(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you cannot call on_message
, it is called by plezi when a websocket client sends a message to the server, where data
is the contents of the message
app/consumers/courses_consumer.rb
Outdated
if ( Object.const_defined?('EventStream') == false ) | ||
puts "EventStream class not initialized" | ||
else | ||
EventStream.on_message(params) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot call on_message
, it is called internally by plezi only when the websocket server receives a message from the client.
@Bad-Science I'm unsure whether we need the auto_dispatch setting to true. |
According to the Plezi.io : "To set up a route to accept websocket connections, our controller must either implement an on_message(data) callback OR be an auto_dispatch enabled controller (more about this powerful feature soon)." ([http://www.plezi.io/docs/websockets#what-are-websockets-skip-if-you-know]). |
Status so far: I'm confident that I have Kafka pushing messages to the iodine server and now I just need to fix some bugs so that the client side can view the messages from kafka pub/sub stream. @Bad-Science @huangmj7
|
@Bad-Science Next TODO:
|
#7 #8
@Bad-Science: @huangmj7 and I are testing the WebSocket for appropriate functionality atm.