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.
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
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)