Giter VIP home page Giter VIP logo

spring-reactive-playground's Introduction

Spring Reactive Playground is a showcase for experimenting on applications based on Spring Framework 5.0 Reactive support, Spring Data Reactive and Reactive NoSQL drivers.

Getting started

Prerequisite:

For testing MongoDB support, run mongod and enable mongo profile in application.properties.

Run Application#main() in your IDE or ./gradlew bootRun on command line, then open http://localhost:8080/ in your browser and use the various test pages.

License

Spring Reactive Playground is released under version 2.0 of the Apache License.

spring-reactive-playground's People

Contributors

bclozel avatar mp911de avatar rstoyanchev avatar sdeleuze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-reactive-playground's Issues

Configuration Issues

There's a couple of configuration issues from using the code out the box.

The first is that in PostgresConfiguration the username is hardcoded to "seb" instead of coming from the configuration file application.properties.

The second is that the POST request fails with a

Request failure [status: 415, reason: "Content type 'application/json' not supported"]

I suppose the JSON support is not properly configured in the example.

I managed to solve the JSON problem by doing

List<HttpMessageConverter<?>> converters =
            Arrays.asList(new ResourceHttpMessageConverter(),
                new CodecHttpMessageConverter<Object>(new JacksonJsonEncoder(), new JacksonJsonDecoder()),
                new CodecHttpMessageConverter<String>(new StringEncoder(), new StringDecoder()));

handlerAdapter.setMessageConverters(converters);

However, the POST request only accepts a single Person at the time, and not as the Flux<Person> and the documentation seem to suggest that it could also accept an array of them.

In this case I got a JsonMappingException: Can not deserialize instance of playground.Person out of START_ARRAY token because the mapper is trying to get Person type out of the JSON string.

Build fail

I just wanted to build the project and I got compile error: "cannot find symbol ReactiveMongoDbFactory reactiveMongoDbFactory"
Should I add other dependencies? The jar is downloaded but this class is missing...
I use Gradle 3.0 and Windows 10.

Cannot build from source (missing gradle-wrapper.jar)

Once I fixed the gradle wrapper I get compile errors:

...
/home/dsyer/dev/boot/reactive-sample/src/main/java/playground/Application.java:33: error: cannot find symbol
import org.springframework.http.server.reactive.ErrorHandlingHttpHandler;
                                               ^
  symbol:   class ErrorHandlingHttpHandler
  location: package org.springframework.http.server.reactive
/home/dsyer/dev/boot/reactive-sample/src/main/java/playground/Application.java:35: error: cannot find symbol
import org.springframework.http.server.reactive.InternalServerErrorExceptionHandler;
                                               ^
  symbol:   class InternalServerErrorExceptionHandler
  location: package org.springframework.http.server.reactive
/home/dsyer/dev/boot/reactive-sample/src/main/java/playground/mongo/MongoPersonRepository.java:28: error: cannot find symbol
import reactor.Publishers;
              ^
  symbol:   class Publishers
  location: package reactor
...

Update for Spring 5 Build Snapshot that includes reactive support

This repo seems to me that it serves as the canonical example of how Spring with reactive support looks like.
It would be great if it could be updated to use latest Spring 5 build snapshot that includes Reactive support.

Or perhaps is there some example inside the Spring Framework repository that better serves the purpose of demonstrating Spring's reactive capabilities?

Thanks!

Better error handling with Couchbase

Already discussed with Simon Baslé: AsyncN1qlQueryResult API makes not very easy to deal with errors since they are now emitted as errors in the main Observable<AsyncN1qlQueryRow>.

They will maybe provide an adapter to make our job easier in 2.x drivers. API may be improved in 3.x driver

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.