이번 포스팅에서는 maven, springframework, java를 사용한다.
이전 시간에 apache storm 클러스터를 셋팅 해보았다.
그에 맞는 storm버전을 maven pom.xml에 작성해보자.
maven관련 내용은 메이븐레파지토리에서 알수 있다.
https://mvnrepository.com/artifact/org.apache.storm/storm-core/1.0.1
그리고 로깅과 스프링프레임워크 관련도 셋팅 해보자.
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>
<groupId>storm</groupId> <artifactId>game</artifactId> <version>1.0-SNAPSHOT</version>
<properties> <!-- spring --> <spring.version>3.2.13.RELEASE</spring.version> <!-- storm --> <storm.version>1.0.1</storm.version> <httpclient.version>4.5.2</httpclient.version>
<!-- logging --> <slf4j.version>1.7.10</slf4j.version> <logback.version>1.1.2</logback.version> </properties>
<!-- spring --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency>
<!-- storm --> <dependency> <groupId>org.apache.storm</groupId> <artifactId>storm-core</artifactId> <version>${storm.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.storm</groupId> <artifactId>flux-core</artifactId> <version>${storm.version}</version> </dependency>
<!-- Logging --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> <version>${logback.version}</version> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <version>${logback.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>${slf4j.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> <version>${slf4j.version}</version> </dependency>
</dependencies> </project> |
코드는 2가지를 해보려고 한다.
코드실행은 로컬이 아닌 서버에서 동작한다.
코드를 보기전에 용어부터 알아보자.
- Topology : Spout와 Bolt 들간의 흐름을 제어하는 부분! main 함수도 있다~
HelloWorld Sample : https://bcho.tistory.com/991?category=563141
WordCount Sample : https://gyrfalcon.tistory.com/entry/Apache-Storm-2?category=674613
'OpenSource > Apache Storm' 카테고리의 다른 글
Zookeeper 상태 확인 (0) | 2021.11.22 |
---|---|
Docker에 apache storm 셋팅 및 띄워보기!(feat. Zookeeper) (0) | 2021.10.14 |
초 간단 Apache Storm 맛보기(셋팅) (0) | 2020.05.19 |