Skip to content

rsqn/streams-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streams-demo

This is a demo and template project to demonstrate basic client/server interaction using streams-comet.

Using only event based interactions all the way from client to server can really simplify and accelerate application development in applications where there is complex event based activity happening on the server.

How do I run this (demo)?

In your IDE run the following main class and arguments

tech.rsqn.streamsdemo.server.ServerMain --env=LOCAL

or run the maven goal

mvn clean install
mvn exec:java

In your browser

http://localhost:8080

What does this do?

The Server

  • Starts embedded Jetty on http://localhost:8080/
  • tech.rsqn.streamsdemo.server.ServerMain starts up spring/startup-ctx.xml
  • Jetty via web.xml initialises
  • Services such as Comet dependencies and SampleService via app-ctx.xml
  • CometD
  • Javascript and CSS Aggregation filters from https://github.com/rsqn/jjst

The Client

  • index.jsp loads up aggregated Javascript from /js/index.js
  • which Starts up tech.rsqn.streamsdemo.StreamApp
  • StreamApp
  • Connects to comet via the tech.rsqn.streams.Stream abstraction
  • Initializes EchoWidget
  • EchoWidget
  • Subscribes to the stream /service/sample/echo-response
  • On subscription requests SampleService to send some data by publishing a request to /service/sample/multi-echo
  • Logs the responses (to console)