Commit f38a1e11 authored by dietricf's avatar dietricf
Browse files

SI-264 Enable MessageQueue

parent 044bc1e5
...@@ -30,7 +30,7 @@ gridFailureInformation: ...@@ -30,7 +30,7 @@ gridFailureInformation:
jwt: jwt:
tokenHeader: Authorization tokenHeader: Authorization
useStaticJwt: false useStaticJwt: true
staticJwt: eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJIYlI3Z2pobmE2eXJRZnZJTWhUSV9tY2g3ZmtTQWVFX3hLTjBhZVl0bjdjIn0.eyJqdGkiOiI5MGI0NGFkOC1iYjlmLTQ1MzktYTQwYy0yYjQyZTNkNjNiOGEiLCJleHAiOjE1Nzg2NTU3OTUsIm5iZiI6MCwiaWF0IjoxNTc4NjU1NDk1LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvRWxvZ2Jvb2siLCJhdWQiOiJlbG9nYm9vay1iYWNrZW5kIiwic3ViIjoiODYyNjY5NmYtZjFhMi00ZGI1LTkyZWYtZTlhMjQ2Njg1YTU0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiZWxvZ2Jvb2stYmFja2VuZCIsImF1dGhfdGltZSI6MCwic2Vzc2lvbl9zdGF0ZSI6IjJmMWIzODE5LWZjNjQtNDEzNC1iNWQxLWY3ZWY4NzU5NDBkNCIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsia29uLWFkbWluIiwia29uLXdyaXRlciIsImtvbi1hY2Nlc3MiLCJrb24tcmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIs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cmVhZGVyIl19LCJyZXNvdXJjZV9hY2Nlc3MiOnt9LCJuYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSBUZXN0ZXJMYXN0bmFtZV9yd2EiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJ0ZXN0dXNlcl9yd2EiLCJnaXZlbl9uYW1lIjoiVGVzdGVyRmlyc3RuYW1lX3J3YSIsImZhbWlseV9uYW1lIjoiVGVzdGVyTGFzdG5hbWVfcndhIn0.DAYXuv4tKn8RXqO1jyttnD-tF4nShUBQyfe4bKbAiPAyY2x5YbAf3M4eXnLrGqo8-loGKldICC28bL0LaMA3KKkQEOfW5sfpGqoN6212vs89mOklt0TJYc5PMXwFgJ5WC_TKjdwq7-aaDafOEWehV0U1ut3s-94ovNYIEn29nzXm2W1ldoXJEq03F880jlysQ5zlRvGF7eXEEpFfI2URyyNQ2UWh0Ssfq-gOAt2pbF1u6prA5RfvUmZ3v1eu21YLGZtgqPqxb1l6odyH3ip15j_HdgnTeo52ymxuRUj65Mskme3V5ev2DitHI9vZgnpV8Idhb4TTWliBeGCOMfDFCg
services: services:
......
...@@ -9,22 +9,15 @@ ...@@ -9,22 +9,15 @@
<relativePath/> <!-- lookup parent from repository --> <relativePath/> <!-- lookup parent from repository -->
</parent> </parent>
<groupId>org.eclipse.openk</groupId> <groupId>org.eclipse.openk</groupId>
<artifactId>grid-failure-information.backend.service</artifactId> <artifactId>grid-failure-information.backend.test-import-service</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<name>grid-failure-information</name> <name>grid-failure-information.TestImportService</name>
<description>Grid-Failure-Information Project for openKONSEQUENZ</description> <description>Grid-Failure-Information Project for openKONSEQUENZ</description>
<properties> <properties>
<skip.asciidoc>false</skip.asciidoc> <skip.asciidoc>false</skip.asciidoc>
<maven.test.skip>false</maven.test.skip> <maven.test.skip>false</maven.test.skip>
<flyway.sqlMigrationSeparator>__</flyway.sqlMigrationSeparator>
<flyway.url>jdbc:postgresql://entopticadirx:5432/GridFailureInfoDevServer</flyway.url>
<flyway.user>gfi_service</flyway.user>
<flyway.password>gfi_service</flyway.password>
<flyway.schemas>public</flyway.schemas>
<flyway.locations>filesystem:src/main/resources/db/migration/</flyway.locations>
<java.version>1.8</java.version> <java.version>1.8</java.version>
<spring-cloud.version>Hoxton.RELEASE</spring-cloud.version> <spring-cloud.version>Hoxton.RELEASE</spring-cloud.version>
<springfox.version>2.9.2</springfox.version> <springfox.version>2.9.2</springfox.version>
...@@ -50,19 +43,6 @@ ...@@ -50,19 +43,6 @@
</properties> </properties>
<dependencies> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-oauth2-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
...@@ -76,32 +56,6 @@ ...@@ -76,32 +56,6 @@
<artifactId>spring-boot-starter-integration</artifactId> <artifactId>spring-boot-starter-integration</artifactId>
<version>2.2.5.RELEASE</version> <version>2.2.5.RELEASE</version>
</dependency> </dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway-core.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<version>${openfeign.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-ribbon</artifactId>
<version>${openfeign.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>${keycloak-core.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
...@@ -114,11 +68,6 @@ ...@@ -114,11 +68,6 @@
<version>${mapstruct.version}</version> <version>${mapstruct.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jsonwebtoken.version}</version>
</dependency>
<dependency> <dependency>
<groupId>io.springfox</groupId> <groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId> <artifactId>springfox-swagger2</artifactId>
...@@ -140,24 +89,12 @@ ...@@ -140,24 +89,12 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<version>${spring-security-test.version}</version>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<groupId>org.powermock</groupId> <groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId> <artifactId>powermock-reflect</artifactId>
<version>${powerMockReflect.version}</version> <version>${powerMockReflect.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>${h2.version}</version>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.batch</groupId> <groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId> <artifactId>spring-batch-core</artifactId>
...@@ -181,7 +118,7 @@ ...@@ -181,7 +118,7 @@
</dependencies> </dependencies>
<dependencyManagement> <!--dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
...@@ -191,7 +128,7 @@ ...@@ -191,7 +128,7 @@
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement-->
<build> <build>
<finalName>${project.artifactId}</finalName> <finalName>${project.artifactId}</finalName>
......
package org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures; package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@SpringBootApplication @SpringBootApplication
@EnableSwagger2
public class TestImportGridFailuresApplication { public class TestImportGridFailuresApplication {
public static void main(String[] args) { public static void main(String[] args) {
......
package org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.config; package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.config;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.amqp.core.DirectExchange; import org.springframework.amqp.core.DirectExchange;
...@@ -6,7 +6,6 @@ import org.springframework.amqp.core.Exchange; ...@@ -6,7 +6,6 @@ import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.integration.annotation.ServiceActivator; import org.springframework.integration.annotation.ServiceActivator;
......
...@@ -12,26 +12,17 @@ ...@@ -12,26 +12,17 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
******************************************************************************* *******************************************************************************
*/ */
package org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.controller; package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.controller;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ApiResponses;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.dtos.ForeignFailureDto; import org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.dtos.ForeignFailureDto;
import org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.service.ImportService; import org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.service.ImportService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import java.net.URI;
import java.util.List;
import java.util.UUID;
@Log4j2 @Log4j2
@RestController @RestController
......
...@@ -12,22 +12,18 @@ ...@@ -12,22 +12,18 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
******************************************************************************* *******************************************************************************
*/ */
package org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.dtos; package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.dtos;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.UUID;
@Data @Data
public class ForeignFailureDto implements Serializable { public class ForeignFailureDto implements Serializable {
private Long id;
private String source; private String source;
private String metaId; private String metaId;
private String description; private String description;
private String json; private String json;
private String rabbitMqChannel;
private String rabbitMqKey; private String rabbitMqKey;
} }
...@@ -12,23 +12,22 @@ ...@@ -12,23 +12,22 @@
* SPDX-License-Identifier: EPL-2.0 * SPDX-License-Identifier: EPL-2.0
******************************************************************************* *******************************************************************************
*/ */
package org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.service; package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.service;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures.dtos.ForeignFailureDto; import lombok.extern.log4j.Log4j2;
import org.eclipse.openk.gridfailureinformation.jobs.importgridfailures.dtos.ForeignFailureDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.messaging.support.MessageBuilder; import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.context.annotation.Lazy;
import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageChannel;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.List;
import java.util.stream.Collectors;
@Service @Service
@Log4j2
@EnableConfigurationProperties @EnableConfigurationProperties
@ConfigurationProperties(prefix = "rabbitmq") @ConfigurationProperties(prefix = "rabbitmq")
public class ImportService { public class ImportService {
...@@ -49,7 +48,7 @@ public class ImportService { ...@@ -49,7 +48,7 @@ public class ImportService {
.build()); .build());
} catch (Exception e) { } catch (Exception e) {
//log.debug(e.getMessage(), e); log.debug(e.getMessage(), e);
} }
......
...@@ -17,6 +17,15 @@ spring: ...@@ -17,6 +17,15 @@ spring:
password: gfi_service password: gfi_service
flyway: flyway:
enabled: false enabled: false
rabbitmq:
host: entdockergss
port: 5672
username: guest
password: guest
rabbitmqconfig:
routing-key: messageImportChannel.process
exchange-name: messageImportChannel
server: server:
max-http-header-size: 262144 max-http-header-size: 262144
......
...@@ -18,7 +18,7 @@ spring: ...@@ -18,7 +18,7 @@ spring:
flyway: flyway:
enabled: false enabled: false
rabbitmq: rabbitmq:
host: 192.168.99.100 host: entdockergss
port: 5672 port: 5672
username: guest username: guest
password: guest password: guest
...@@ -39,7 +39,7 @@ index-channel: ...@@ -39,7 +39,7 @@ index-channel:
enabled: true enabled: true
server: server:
port: 9165 port: 9167
max-http-header-size: 262144 max-http-header-size: 262144
servlet: servlet:
session: session:
......
package org.eclipse.openk.gridfailureinformation.jobs.ImportGridfailures; package org.eclipse.openk.gridfailureinformation.jobs.importgridfailures;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment