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-issuemaster opened this issue Jan 11, 2017 · 12 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Jan 11, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 11, 2017

James Burton commented

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

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 16, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 16, 2017

Rossen Stoyanchev commented

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

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

James Burton commented

Ah right, that makes sense, thanks.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 17, 2017

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-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 23, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.