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

Support for Messaging controllers #373

Open
Polve opened this issue Mar 26, 2017 · 3 comments
Open

Support for Messaging controllers #373

Polve opened this issue Mar 26, 2017 · 3 comments

Comments

@Polve
Copy link

Polve commented Mar 26, 2017

Controllers using MessageMapping(s) instead of rest endpoint have very similar requirements for documentation.
Could spring-restdocs be used for those controllers too?

@wilkinsona
Copy link
Member

There's nothing available out-of-the box for this, but I'm not against adding something. The name REST Docs is already stretched as you can document any HTTP-based API not just those that are RESTful. Stretching things further to include @MessageMapping-based controller doesn't seem unreasonable to me.

It would be interesting to see how far things could get by writing a ChannelInterceptorAdapter subclass and turning the messages it intercepts into a REST Docs Operation. It'll break down quite quickly in some areas (pub-sub vs request-response, for example), but I think it may still be a useful exercise.

@dsyer
Copy link
Member

dsyer commented Oct 11, 2017

A ChannelInterceptorAdapter could cover Spring Integration as well, which would be neat. Spring Cloud Contract already has support for "stubs" on messages, but not the documentation part, so a generic messaging adapter (perhaps something that can cover Spring AMQP and Spring Kafka as well) would be awesome.

@dsyer
Copy link
Member

dsyer commented Jan 30, 2018

I made some sample apps and got them working with Spring Cloud Stream (and Contracts): https://github.com/dsyer/spring-restdocs-messaging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants