GithubHelp home page GithubHelp logo

test-websocket's Introduction

Build Status Coverage Status

Simple project for work with Websocket: spring-boot, jetty-embedded

Explanation of technology choice:

  1. Build system
    • Alternatives: Maven, Gradle, ANT, SBT
    • Selected: Gradle
    • Reason: Gradle is declarative build system for Java project (same as Maven), that designed to build not only Java projects, and have many possibilities for change behavior of build process
  2. Embedded servlet container
    • Alternatives: Tomcat embedded, Jetty
    • Selected: Jetty
    • Reason: Jetty has less footprint (~ 1.4 MiB, ~ 1.7 MiB with websocket implementation) than Tomcat (~ 2.7 MiB, 2.9 MiB with websocket implementation)
  3. WebSocket connection mode: in test client (JavaScript) and server simultaneously implemented two modes (pure websocket connection, and Sock.JS+STOMP)
    1. Pure websocket:
      • Advantages:
        • direct use WebSocket object in JavaScript
        • no additional overhead
      • Disadvantages:
    2. Sock.JS+STOMP
      • Advantages:
        • work even browser does not support WebSocket or connection to WebSocket server is blocked
        • supported by Spring
      • Disadvantages:
        • add overhead with STOMP protocol
        • require additional library for interact with server

Useful gradle commands

  1. Run project from console: ./gradlew bootRun
  2. Build executable jar: ./gradlew build
  3. Build test coverage report: ./gradlew check jacocoTestReport and open build/reports/jacoco/test/html/index.html
  4. Run project in WildFly 10.0.0: ./gradlew build cargoRunLocal
    • Sometimes WildFly could not access to temp file on VFS and fail deploy, in this case you need to stop WildFly and run command second time
    • Sometimes cargo could not stop launched application server, in this case you can try stop server by command ./gradlew cargoStopLocal or kill java manual

test-websocket's People

Contributors

valery1707 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.