Skip to content

Commit

Permalink
Addresses #43 (api_gateway, user_management, mysql)
Browse files Browse the repository at this point in the history
  • Loading branch information
aniruddhavpatil committed Mar 1, 2020
1 parent b472f6b commit 6f6e0a0
Show file tree
Hide file tree
Showing 77 changed files with 172 additions and 3,543 deletions.
32 changes: 0 additions & 32 deletions KafkaConsumer/.classpath

This file was deleted.

40 changes: 0 additions & 40 deletions KafkaConsumer/.project

This file was deleted.

2 changes: 0 additions & 2 deletions KafkaConsumer/.settings/org.eclipse.core.resources.prefs

This file was deleted.

9 changes: 0 additions & 9 deletions KafkaConsumer/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions KafkaConsumer/.settings/org.springframework.ide.eclipse.prefs

This file was deleted.

7 changes: 0 additions & 7 deletions KafkaConsumer/target/classes/META-INF/MANIFEST.MF

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions KafkaConsumer/target/classes/application.properties

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 5 additions & 0 deletions api_gateway/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM openjdk:13-jdk

ADD api_gateway.jar /

CMD [ "java", "-jar", "./api_gateway.jar" ]
File renamed without changes.
27 changes: 27 additions & 0 deletions api_gateway/KafkaProducer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM openjdk:13-jdk

ARG MAVEN_VERSION=3.6.3
ARG USER_HOME_DIR="/root"
ARG SHA=c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
ARG BASE_URL=https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries

RUN mkdir -p /usr/share/maven /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz ${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz \
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha512sum -c - \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

COPY mvn-entrypoint.sh /usr/local/bin/mvn-entrypoint.sh
COPY settings-docker.xml /usr/share/maven/ref/

# ADD KafkaProducer /

# RUN cd /KafkaProducer

ENTRYPOINT ["/usr/local/bin/mvn-entrypoint.sh"]

CMD ["mvn"]
Binary file added api_gateway/KafkaProducer/api_gateway.jar
Binary file not shown.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class ApiGatewayResource {
@Autowired KafkaTemplate<String,SessionRequestTemplate> kafkaTemplateSession;


@CrossOrigin(origins = "http://localhost:3000", maxAge = 3600)
@CrossOrigin(origins = "http://ui:3000", maxAge = 3600)
@RequestMapping(value="/login", method = RequestMethod.POST, consumes = "application/json")
public String login(@RequestBody String message) throws InterruptedException {
//String message=user.getFirstName();
Expand All @@ -60,7 +60,7 @@ public String login(@RequestBody String message) throws InterruptedException {
return ack;
}

@CrossOrigin(origins = "http://localhost:3000", maxAge = 3600)
@CrossOrigin(origins = "http://ui:3000", maxAge = 3600)
@RequestMapping(value="/register", method = RequestMethod.POST, consumes = "application/json")
public String register(@RequestBody String message) throws InterruptedException {
kafkaTemplate.send(TOPIC_REGISTER_MESSAGE,message);
Expand All @@ -77,7 +77,7 @@ public String register(@RequestBody String message) throws InterruptedException



@CrossOrigin(origins = "http://localhost:3000", maxAge = 3600)
@CrossOrigin(origins = "http://ui:3000", maxAge = 3600)
@RequestMapping(value="/dataretrieval", method = RequestMethod.POST, consumes = "application/json")
public String dataRetrival(@RequestBody String message) throws InterruptedException {
kafkaTemplate.send(TOPIC_DATARETRIVE_MESSAGE,message);
Expand All @@ -94,7 +94,7 @@ public String dataRetrival(@RequestBody String message) throws InterruptedExcept
}


@CrossOrigin(origins = "http://localhost:3000", maxAge = 3600)
@CrossOrigin(origins = "http://ui:3000", maxAge = 3600)
@RequestMapping(value = "/sessionmgmt"/* , method = RequestMethod.POST, consumes = "application/json" */)
public String sessionManagement(/* @RequestBody String sessionDetails */)
throws InterruptedException, URISyntaxException, JSONException, ExecutionException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class KafkaProducerConfiguration {
public ProducerFactory producerFactory(){

Map<String,Object> config= new HashMap<>();
config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"127.0.0.1:9092" );
config.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG,"kafka:9092" );
config.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG,JsonSerializer.class );
config.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG,JsonSerializer.class );

Expand All @@ -54,7 +54,7 @@ public KafkaTemplate<String,String> kafkaTemplate(){
public ConsumerFactory<String, String> consumerFactory(){
Map<String,Object> config =new HashMap<>();

config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "127.0.0.1:9092");
config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "kafka:9092");
config.put(ConsumerConfig.GROUP_ID_CONFIG, "group_id");
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
@SpringBootTest
class KafkaProducerApplicationTests {

@Test
void contextLoads() {
}
// @Test
// void contextLoads() {
// }

}
Binary file renamed api_gateway.jar → api_gateway/api_gateway.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions data-retrieval/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
FROM python:3-onbuild

ADD dataretrieval.py /
RUN pip install --upgrade pip
RUN pip3 install --upgrade pip
ADD requirements.txt /
RUN pip3 install -r requirements.txt
RUN echo "RUN DONE"

CMD [ "python3", "./dataretrieval.py" ]
Loading

0 comments on commit 6f6e0a0

Please sign in to comment.