Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spencergibb/spring-cloud-bus-rsocket-sample
Sample app that uses spring-cloud-bus with RSocket Routing as the transport
https://github.com/spencergibb/spring-cloud-bus-rsocket-sample
Last synced: 20 days ago
JSON representation
Sample app that uses spring-cloud-bus with RSocket Routing as the transport
- Host: GitHub
- URL: https://github.com/spencergibb/spring-cloud-bus-rsocket-sample
- Owner: spencergibb
- License: apache-2.0
- Created: 2020-10-23T21:15:53.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-23T22:14:27.000Z (about 4 years ago)
- Last Synced: 2024-10-10T05:37:16.764Z (about 1 month ago)
- Language: Java
- Size: 58.6 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spring-cloud-bus-rsocket-sample
Sample app that uses spring-cloud-bus with RSocket Routing as the transport.1. Clone https://github.com/spencergibb/rsocket-routing-sample and run `BrokerApplication`
2. Run `DemobusApplication`
3. Run `DemobusApplication --spring.profiles.active=bus2`
4. Run `http POST :8080/actuator/busrefresh` or `http POST :8080/actuator/busrefresh/service_name=busclient`. You should see something like the following in the `DemobusApplication` output
```
2020-10-23 15:23:51.548 DEBUG 206569 --- [tor-tcp-epoll-2] o.springframework.cloud.bus.BusConsumer : Received remote event from bus: [RefreshRemoteApplicationEvent@12fd361c id = '14d10461-a197-4773-95ac-9030a59cd96d', originService = 'busclient:busclient-1', destinationService = 'bus=true']
2020-10-23 15:23:51.548 INFO 206569 --- [tor-tcp-epoll-2] o.s.cloud.bus.event.RefreshListener : Received remote refresh request.
2020-10-23 15:23:51.659 INFO 206569 --- [tor-tcp-epoll-2] o.s.cloud.bus.event.RefreshListener : Keys refreshed []
```The selector after `/busrefresh` is semicolon `/` delimited name=value pairs. So `/actuator/busrefresh/service_name=busclient/instance_name=busclient-2` would match client two.
In busclient-1 you would see something like
```
2020-10-23 16:06:50.810 INFO 214362 --- [nio-8080-exec-1] o.s.cloud.bus.event.RefreshListener : Refresh not performed, the event was targeting bus=true;service_name=busclient;instance_name=busclient-2
```
while busclient-2 would see the received messages.