Code Monkey home page Code Monkey logo

spring-boot-vaadin-rabbitmq-pipeline-demo's Introduction

Spring-Boot, Vaadin, RabbitMQ, Data Pipeline Demo

Overview

This Demo App Showcases the following Latest Technology Stack:

  • Spring AMQP Client
    • RabbitTemplate
    • SimpleMessageListenerContainer
    • MessageListener
  • Vaadin - #1 Java Web UI Framework for Business Applications
    • Vaadin UI, Vaadin Navigation, Vaadin @Push (WebSocket)
    • A single page web application, and purely in Java
  • Spring Boot Application
    • Spring REST
    • Spring Test
    • Spring Security
    • Spring Data JPA
    • Spring AMQP
    • Spring Web
  • H2 In-Memory Database
  • Jayway JsonPath

The Complete Maven pom.xml

You can find the complete Maven pom.xml.

Pipeline Processing Design

demo app

Prerequisites

This Demo App uses RabbitMQ as its Message Broker. You install RabbitMQ locally.

Install RabbitMQ Locally

Please follow the instructions to download and install RabbitMQ locally before you can run this Demo App.

Downloading and Installing RabbitMQ

Set RabbitMQ host, username, & password in application.properties

Set these values for RabbitMQ in 'application.properties' file only if they're different from the default values.

rabbitmq.host=localhost
rabbitmq.username=guest
rabbitmq.password=guest

Install

Get the Demo App Source Code

You can get the Demo App source code here using the upper-right "Clone or download" button.

OR, use the command:

$ git clone https://github.com/MikeQin/spring-boot-vaadin-rabbitmq-pipeline-demo.git

Preferrable, you import the source code into your favorite IDE, such as Eclipse, or IntelliJ IDEA

Run

You can run this Demo App:

mvn spring-boot:run

Demo App in Browser

http://localhost:8080

Basic Authentication Login

username: admin

password: admin

There are currently two Roles: 'ADMIN', 'USER'

USER longin: user / user

  • 'USER' does not have privilege to call RESTful APIs, or view H2 Database console. See below for detail.
  • 'ADMIN' role can perform all tasks.

Demo App UI

Demo View

demo view

Streaming View

stream view

Console Log

stream log

RESTful APIs

When you login as 'ADMIN' using browser:

http://localhost:8080/events

Returns all events.

events

http://localhost:8080/events?type=INFO

Returns 'INFO' type events.

Event types: 'INFO', 'WARNING', 'ERROR'.

http://localhost:8080/user

Returns current login.user

RabbitMQ Management UI

Exchange: x.topic.logs

exchange

Queues: q.logs.info, q.logs.warning, q.logs.error

queues

H2 Database Console

When you login as 'ADMIN' using browser:

http://localhost:8080/console

Please note the following H2 configurations (also in application.properties)

spring.datasource.url=jdbc:h2:file:~/test;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.driverClassName=org.h2.Driver

h2 console

To see all persisted events.

spring-boot-vaadin-rabbitmq-pipeline-demo's People

Contributors

mikeqin avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

spring-boot-vaadin-rabbitmq-pipeline-demo's Issues

Multi session bug

Thank you for the nice project.
When I try to open it on two tabs on normal and one on private mode I get the exception:

"status":500,"error":"Internal Server Error","exception":"com.vaadin.server.ServiceException","message":"org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoView': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot remove from parent when the session is not locked. Furthermore, there is another locked session, indicating that the component might be about to be moved from one session to another.","path":"/"

Do you know what might be the cause ?

[question] Purpose of H2

Hi buddy,

first of all thanks for this example. what is the purpose of H2 database here? Is it for purpose of application cache like engine?

I was more considering directly streaming messages to the screens from message broker. Note that I am adopter of Saga, Audit, Event Sourcing and CQRS patterns in microservices architecture.

I am interested in use case with H2 here, I think it is not required when you fully adopt Asynchronous architecture.

Thanks.

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.