Git Product home page Git Product logo

chat-messaging-example's Introduction

Spring Messaging Example wih Stomp Websockets & Spring amqp

General

This is a Spring Boot Messaging Example serving different Websockets clients: a Swing client using the the Spring Stomp Java Client and a Javascript client using the stomp.js libarary, with dynamic / selective Endpoints with different ClientExample with dynamic / selective Endpoints. Rabbitmq is used as Relay host for the Stomp Messaging.

Also there is a Spring Boot Server, which uses Spring amqp Messaging to send & retrieve Messages to/from the same Topics as the Websocket Clients

One can send notifications over Stomp to all clients or selective Clients, using a unique id for each Client instance.

The Websockets are unsecured, since i have'nt found out, how to use the Spring Java Stomp Client with secured Websockets.

The Web clients require a login, the Swing client does'nt.

Usage

In for example Eclipe

  1. Start /stomp-server/src/main/java/chat/TestChatServer.java

For the Javascript stomp.js clients

  1. Open various Browser Instance. Macos in Terminal: open -n /Applications/Safari.app
  2. http://localhost:8080
  3. Login either as u01, u11 or u21. With password being same as username
  4. Connect
  5. Enter a shout with a to = being a logged in user or to being empty -> to all
  6. The shout should be displayed, after a couple of secs for the respective user(s)
  7. Ener a shout with being one of the ids displayed
  8. The shout should be displayed only for the respective client with the id

For the Swing client

  1. Run /stomp-swing-client/src/main/java/chat/ChatUi.groovy as Groovy Script
  2. Similar UI as with the browser

Preconditions

A running Rabbitmq host, with the Stomp Plugin enabled, see also https://www.rabbitmq.com/stomp.html

rabbitmq-plugins enable rabbitmq_stomp

Implementation Notes

For for Stomp Messaging, see /chat-stomp-server/src/main/java/chat/ChatController.java and /chat-stomp-server/src/main/java/chat/WebSocketRelayConfig.java

chat-messaging-example's People

Contributors

chhex avatar dependabot[bot] avatar nickebbutt avatar

Stargazers

 avatar

Watchers

 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.