Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable spring cloud stream binding for develop purposes?

I need to disable publication and subscription on events for development, but I can't find some configuration properties/other solution for this. How can I do this?

Possible solution: to create autoconfiguration with @EnableBinding on some property set and in a case of disabled replace all binding interfaces with generated no-op stubs. But maybe more simple solution exist?

like image 782
injecto Avatar asked Aug 16 '17 10:08

injecto


2 Answers

I am facing a similar situation where our code will be deployed to production. But these need to be disabled until we have other teams ready to publishing there messages, so we want to tell spring cloud stream to not to initialize any beans until we specify specific configuration.

I tried to look at the what @Vinicius menthod .. but looks that only provides a way to stopping, resuming channels once the application is started.

Is there some thing we can specific to stop these beans while starting an application.

like image 184
user2225713 Avatar answered Sep 21 '22 11:09

user2225713


Selective start and stop of bindings is currently not supported. We are tracking this to be a 2.0 feature. You can track its progress here: https://github.com/spring-cloud/spring-cloud-stream/issues/763

like image 24
Vinicius Carvalho Avatar answered Sep 23 '22 11:09

Vinicius Carvalho