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

Validator is not set after initializing web socket MessageBroker from xml configuration [SPR-13996] #18569

Closed
spring-projects-issues opened this issue Feb 27, 2016 · 3 comments
Assignees
Labels
in: messaging Issues in messaging modules (jms, messaging) in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Feb 27, 2016

Maksim Orlov opened SPR-13996 and commented

org.springframework.web.socket.config.MessageBrokerBeanDefinitionParser class doesn't contain any link to validator class, as result the Validator field in SimpAnnotationMethodMessageHandler and then in PayloadArgumentResolver is null and validation doesn't work at controller methods with @MessageMapping.

I was able to make validation working by using java config of MessageBroker.

The AbstractMessageBrokerConfiguration class performs validator configuration at this case.


Affects: 4.2.5

Reference URL: #15811

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

Brian Clozel commented

I've added a new XML attribute to configure a custom Validator:

<websocket:message-broker
    application-destination-prefix="/app"
    user-destination-prefix="/personal"
    validator="myValidator">
  <!-- ... -->
</websocket:message-broker> 

@spring-projects-issues
Copy link
Collaborator Author

Maksim Orlov commented

Many thanks for the quick fix.

@spring-projects-issues
Copy link
Collaborator Author

Brian Clozel commented

Thanks for the report Maksim Orlov!
This should be available in the latest 4.3.0.BUILD-SNAPSHOT version if you'd like to test this.

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

No branches or pull requests

2 participants