Spring Tips: The Reactor Context

Sdílet
Vložit
  • čas přidán 5. 07. 2024
  • Hi Spring fans! In this installment of Spring Tips we answer the question, "how do I propagate state across asynchronous, reactive execution pipelines?"
    speaker: Josh Long
    / starbuxman
  • Věda a technologie

Komentáře • 11

  • @hubertyczek8994
    @hubertyczek8994 Před 5 lety

    Thanks! Keep posting :-)

  • @harryfernando8682
    @harryfernando8682 Před 2 lety +1

    Hi Josh , How can we use logOnNext with different maps, faltmaps in a pipeline ?

  • @ganga5809
    @ganga5809 Před 2 lety

    Hi Josh,
    I got one example like XPathFactory instantiation XPathFactory.newInstance(), which is not thread safe hence we can use Context to store the factory here. But I can see in your examples the Context is shared among the different threads, should we have to manage ourself to make it available on the same thread only ?

  • @VigneshBhaskar
    @VigneshBhaskar Před 4 lety

    Hi Josh, I don't see a lot of examples online using Reactive Websockets. Currently am using Websockets with UnicastProcessor for my chat room application. Can this use-case be dealt with RSockets or is RSockets just for intercommunication between Microservices? Pls, advise.

    • @coffeesoftware
      @coffeesoftware Před 4 lety

      hi bud -check out this example. the important bit is that you need a `WebSocketHandlerAdapter,` a `WebSocketHandler`, and a `SimpleUrlHandlerMapping`. github.com/joshlong/reactive-revolution/blob/master/main/rsocket-service/src/main/java/com/example/service/ServiceApplication.java#L110
      as for RSocket, well, your browser isn't going to understand RSocket by default. you can use a JS library to speak RSocket on top of WebSockets, but it's an extra layer. You could use RSocket to handle a chat application, though, absolutely. You'd also get some nice benefits including the ability to then more naturally consume that cha API from any RSocket client, headers ("metadata"), Spring Security JWT/Simple authentication , and more

    • @VigneshBhaskar
      @VigneshBhaskar Před 4 lety

      @@coffeesoftware Thanks a lot. Will try them.

  • @ashtwenty12
    @ashtwenty12 Před 5 lety

    Great video. Is this or similar on git ?

    • @coffeesoftware
      @coffeesoftware Před 4 lety +2

      github.com/spring-tips - all the repositories for all the videos are there

  • @privettoli
    @privettoli Před 5 lety

    Hi Josh! It looks like some kind of MDC-style development. I see only logging as the appropriate need to use reactive context, nothing else.

    • @privettoli
      @privettoli Před 5 lety

      I just had to write that comment before watching the whole video)))))

    • @coffeesoftware
      @coffeesoftware Před 5 lety

      I think you're missing some interesting opportunities. Spring Data uses it for transaction demarcation. Spring Security uses it for propagation of principal information. HTH