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
| #myrabbit or mykafka? | |
| spring.cloud.stream.defaultBinder = mykafka | |
| spring.cloud.stream.bindings.input.destination=beers-channel | |
| spring.cloud.stream.bindings.input.group = beers-group | |
| #Kafka Settings: | |
| spring.cloud.stream.binders.mykafka.type = kafka | |
| spring.cloud.stream.binders.mykafka.environment.spring.cloud.stream.kafka.binder.brokers = localhost:9092 | |
| spring.cloud.stream.binders.mykafka.environment.spring.cloud.stream.kafka.binder.zkNodes = localhost:2181 |
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
| @Component | |
| @Slf4j | |
| class BeerHandler { | |
| @Autowired | |
| BeerRepository repo; | |
| @StreamListener(target=Sink.INPUT) | |
| public void handleBeerMessage (String message) { | |
| log.info("Received beer: {}", message); |
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
| @SpringBootApplication | |
| @EnableBinding(Source.class) | |
| public class BeerClientApplication { | |
| public static void main(String[] args) { | |
| SpringApplication.run(BeerClientApplication.class, args); | |
| } | |
| } |
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
| #mykafka or myrabbit? | |
| spring.cloud.stream.defaultBinder = mykafka | |
| #Target Stream for beers channel | |
| spring.cloud.stream.bindings.output.destination = beers-channel | |
| #Kafka Settings: | |
| spring.cloud.stream.binders.mykafka.type = kafka | |
| spring.cloud.stream.binders.mykafka.environment.spring.cloud.stream.kafka.binder.brokers = localhost:9092 | |
| spring.cloud.stream.binders.mykafka.environment.spring.cloud.stream.kafka.binder.zkNodes = localhost:2181 |
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
| #mykafka or myrabbit? | |
| spring.cloud.stream.defaultBinder = myrabbit | |
| #Target Stream for beers channel | |
| spring.cloud.stream.bindings.output.destination = beers-channel | |
| #RabbitMQ Settings: | |
| spring.cloud.stream.binders.myrabbit.type = rabbit | |
| spring.cloud.stream.binders.myrabbit.environment.spring.rabbitmq.addresses = localhost:5672 |
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
| public interface MyBeerOutput { | |
| String OUTPUT = "output"; | |
| @Output(MyBeerOutput.OUTPUT) | |
| MessageChannel output(); | |
| } |
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
| public interface MyBeerOutput { | |
| String OUTPUT = "output"; | |
| @Output(Source.OUTPUT) | |
| MessageChannel output(); | |
| } |
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
| @RestController | |
| @Slf4j | |
| class BeerNamesController { | |
| @Output(Source.OUTPUT) | |
| @Autowired | |
| private MessageChannel messageChannel; | |
| @Autowired | |
| RestTemplate restTemplate; |
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
| @RestController | |
| @Slf4j | |
| class BeerNamesController { | |
| @Output(Source.OUTPUT) | |
| @Autowired | |
| private MessageChannel messageChannel; | |
| @Autowired | |
| RestTemplate restTemplate; |
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
| FROM ubuntu | |
| MAINTAINER Kimbro Staken | |
| RUN apt-get install -y python-software-properties python python-setuptools ruby rubygems | |
| RUN add-apt-repository ppa:chris-lea/node.js | |
| RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list | |
| RUN apt-get update | |
| RUN apt-get install -y nodejs | |
| RUN apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 |