Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the Spring stomp broker relay forces reactor 2 and prevents using reactor 3 [SPR-15129] #19696

Closed
spring-projects-issues opened this issue Jan 11, 2017 · 12 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

James Burton opened SPR-15129 and commented

This is really more of a note than a request or issue. However, it might be worth adding a bit of text in the reference docs to ensure users know about this consequence if they opt to use the stomp broker relay.

I have been using the stomp broker relay (StompBrokerRelayMessageHandler) successfully in a spring boot project for about a year. However, I now want to start using reactor 3 in my project. Unfortunately, the spring stomp broker relay requires reactor 2 and will not work if reactor 3 is present instead.

I understand that spring boot v2 will have reactor 3 so I guess it will be upgraded in spring 5. My use of this broker is non-critical, so I will switch to the built-in spring stomp simple broker until the stomp broker relay is upgraded to reactor 3.


Affects: 4.3.5

Referenced from: commits 70a1ecb

@spring-projects-issues
Copy link
Collaborator Author

James Burton commented

For the record, my issue related to this is the-james-burton/the-turbine#24

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Reactor 2 and 3 have a different package structure so it is possible to run with both on the same classpath. In fact we used to do exactly that in Spring Framework tests until we upgraded the STOMP broker relay in Spring Framework 5 M4 to use Reactor 3 and Reactor Netty 0.6.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

We can mention this in the docs for 4.3.x.

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

The Reactor 2 dependency is becoming quite a big deal in other places. People want to use Reactor 3 and Spring Boot has to manage it down to 2.x to stay compatible with Spring Websockets and Stomp. Ideally we would like to bump Reactor to 3.x in Spring Boot 1.5 (though it's getting a bit late for that). Wouldn't it be better to remove the reactor dependency completely from the Stomp support (e.g. re-jar it)?

@spring-projects-issues
Copy link
Collaborator Author

James Burton commented

I didn't think it was possible to have both in a maven project, since reactor-core has the same co-ordinates for both v2 and v3. Maven dependency management therefore omits one in favour of the other.

Did you manage to overcome this?

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

I don't think you can do it with Maven (the Spring build is Gradle, so that's probably how they dodged the bullet).

@spring-projects-issues
Copy link
Collaborator Author

James Burton commented

Ah right, that makes sense, thanks.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Not to forget it's also about reactor-netty which is at version 0.6 so I don't think that can make it into Spring Boot 1.5 regardless. If Spring Framework 5 can be used with Spring Boot 1.5 that will be a path towards using Reactor 3.

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

That's kind of the point: Spring 5 can only be used with Boot 1.5 if you are willing to manage the Reactor dependency manually. It's a PIA, frankly, and not at all the experience I'd like people to have trying to make Reactor 3 work.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

Okay you're talking specifically for uses of Reactor Core, not necessarily Reactor Netty? Spring Cloud Stream comes to mind. James Burton is that your use case perhaps?

@spring-projects-issues
Copy link
Collaborator Author

James Burton commented

Yes, exactly. To use the spring stomp broker relay, reactor-net v2 must be added (as the docs state) and that brings in reactor-core v2 as a transitive. It won't work if I override it with reactor-core v3.

This is not a big problem for me personally, since I've now switched to the spring simple broker and so I am free to use reactor 3. With luck, I wont need to use a different part of Spring that depends on reactor 2 until you (and then I) have both upgraded. I'll then go back to using the broker relay when it supports reactor v3. It's really no problem since it is so very easy to switch between the two stomp options.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

After some further discussion with the Spring Framework team and Marius Bogoevici we've decided to update documentation in all the relevant places.

The spring-cloud-stream-reactive module is optional and a bit more forward looking than the current generation of Spring Boot. It already includes instructions requiring Java 8+ and switching from the default Reactor version in Spring Boot. What we're saying effectively is that the use of this module is not supported in combination with STOMP broker messaging in Spring Framework 4.3. I've added a comment on the Spring Framework side and Marius will do the same on the Spring Cloud Stream side.

Shadowing remains the only alternative on the table but it is hardly ideal since spring-messaging depends on reactor-net which brings reactor-core, reactor-bus, and reactor-stream for a combined total of up to 1,286,067 bytes.

@spring-projects-issues spring-projects-issues added in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 4.3.6 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants