Skip to content

Commit

Permalink
Merge pull request #11 from PacktPublishing/installation-instructions
Browse files Browse the repository at this point in the history
Changed port for NewsService
  • Loading branch information
Igor Lozynskyi committed Sep 29, 2018
2 parents c7b9409 + 4cb2d1b commit ca64978
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion chapter-03/news-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ repositories {

dependencies {
compile('org.springframework.boot:spring-boot-starter-data-mongodb')
compile('org.springframework.boot:spring-boot-starter-web')
compile('org.springframework.boot:spring-boot-starter-web') {
exclude module: "spring-boot-starter-tomcat"
}
compile('org.mongodb:mongodb-driver-reactivestreams:1.9.2')
compile('org.mongodb:mongodb-driver:3.8.2')
compile('io.reactivex:rxjava:1.3.3')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
@SpringBootApplication
@EnableRatpack
public class NewsServiceApp {
public static final int NEWS_SERVER_PORT = 8070;

@Autowired
MongoClient client;
Expand Down Expand Up @@ -94,7 +95,7 @@ DatabaseNewsService databaseNews() {

@Bean
HttpNewsService externalNews() {
return () -> HttpClient.newClient(new InetSocketAddress(8080))
return () -> HttpClient.newClient(new InetSocketAddress(NEWS_SERVER_PORT))
.createGet("")
.flatMap(HttpClientResponse::getContent)
.flatMapIterable(bb -> {
Expand Down Expand Up @@ -134,7 +135,7 @@ public static void main(String[] args) throws Exception {
SpringApplication.run(NewsServiceApp.class, args);

RatpackServer.start(spec ->
spec.serverConfig(ServerConfig.embedded().port(8080))
spec.serverConfig(ServerConfig.embedded().port(NEWS_SERVER_PORT))
.handlers(chain -> chain.get(ctx -> ctx.render(json(Arrays.asList(
News.builder()
.author("test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ spring:
database: news

server:
port: 8090
port: 8080

0 comments on commit ca64978

Please sign in to comment.