This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.pivotal.mheath; | |
| import org.cloudfoundry.client.spring.SpringCloudFoundryClient; | |
| import org.cloudfoundry.operations.CloudFoundryOperations; | |
| import org.cloudfoundry.operations.CloudFoundryOperationsBuilder; | |
| import reactor.rx.Stream; | |
| /** | |
| * | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource_pools: | |
| - name: default | |
| cloud_properties: | |
| cpu: 2 | |
| disk: 8192 | |
| ram: 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| status: | |
| port: 8080 | |
| user: router_user | |
| pass: "password" | |
| nats: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |
| import org.springframework.boot.builder.SpringApplicationBuilder; | |
| import org.springframework.context.ApplicationEvent; | |
| import org.springframework.context.ApplicationEventPublisher; | |
| import org.springframework.context.ApplicationListener; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |
| import java.util.concurrent.CountDownLatch; | |
| import java.util.concurrent.Future; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Nats nats = new NatsConnector().addHost("nats://localhost").connect(); | |
| CfNats cfNats = new DefaultCfNats(nats); | |
| cfNats.subscribe(ComponentDiscover.class, new PublicationHandler<ComponentDiscover, ComponentAnnounce>() { | |
| @Override | |
| public void onMessage(Publication<ComponentDiscover, ComponentAnnounce> publication) { | |
| publication.reply(new ComponentAnnounce(...)); | |
| } | |
| }); |