Skip to content

Commit

Permalink
Removing rabbit completely from collex (#257)
Browse files Browse the repository at this point in the history
* Removing rabbit completely from collex

* auto patch increment

* removing redundant class

Co-authored-by: Amit Sinha <[email protected]>
Co-authored-by: ras-rm-pr-bot <[email protected]>
  • Loading branch information
3 people authored Jun 22, 2021
1 parent 030d3e6 commit 8a0c42a
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 680 deletions.
1 change: 0 additions & 1 deletion .sts4-cache/classpath-data.json

This file was deleted.

2 changes: 1 addition & 1 deletion _infra/helm/collection-exercise/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ version: 1.4.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.

appVersion: 11.1.5
appVersion: 11.1.6
28 changes: 0 additions & 28 deletions _infra/helm/collection-exercise/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,34 +137,6 @@ spec:
secretKeyRef:
name: security-credentials
key: security-password
- name: RABBITMQ_HOST
{{- if .Values.managedRabbitMQ.enabled }}
valueFrom:
configMapKeyRef:
name: rabbit-config
key: rabbit-mq-host
{{- else }}
value: "$(RABBITMQ_SERVICE_HOST)"
{{- end }}
- name: RABBITMQ_PORT
{{- if .Values.managedRabbitMQ.enabled }}
valueFrom:
configMapKeyRef:
name: rabbit-config
key: rabbit-mq-port
{{- else }}
value: "$(RABBITMQ_SERVICE_PORT)"
{{- end }}
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: rabbitmq
key: rabbitmq-username
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: rabbitmq
key: rabbitmq-password
- name: SERVER_PORT
value: "{{ .Values.container.port }}"
- name: SECURITY_BASIC_ENABLED
Expand Down
3 changes: 0 additions & 3 deletions _infra/helm/collection-exercise/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ rollingUpdate:
maxSurge: 1
maxUnavailable: 1

managedRabbitMQ:
enabled: false

tomcat:
initialSize: 5
maxActive: 10
Expand Down
10 changes: 0 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ services:
- "18681:8681"
environment:
- PUBSUB_PROJECT1=test,sample_unit_topic:sample_unit_subscription
rabbitmq:
container_name: rabbitmq-it
image: rabbitmq:3.6.10-management
ports:
- "34369:4369"
- "55672:25672"
- "35671:5671"
- "35672:5672"
- "46671:15671"
- "46672:15672"
survey:
container_name: survey-it
image: eu.gcr.io/ons-rasrmbs-management/survey
Expand Down
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@
<artifactId>spring-amqp</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.amqp</groupId>
<artifactId>spring-rabbit</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.annotation.Primary;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.integration.annotation.IntegrationComponentScan;
Expand Down Expand Up @@ -52,7 +51,6 @@
@EntityScan("uk.gov.ons.ctp.response")
@EnableScheduling
@EnableCaching
@ImportResource("springintegration/main.xml")
public class CollectionExerciseApplication {

private static final String VALIDATION_LIST = "collectionexercisesvc.sample.validation";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import net.sourceforge.cobertura.CoverageIgnore;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import uk.gov.ons.ctp.response.collection.exercise.lib.rabbit.Rabbitmq;

/**
* The apps main holder for centralised configuration read from application.yml or environment
Expand All @@ -24,7 +23,6 @@ public class AppConfig {
private RedissonConfig redissonConfig;
private ScheduleSettings schedules;
private SwaggerSettings swaggerSettings;
private Rabbitmq rabbitmq;
private Logging logging;
private GCP gcp;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package uk.gov.ons.ctp.response.collection.exercise.endpoint;

import com.godaddy.logging.Logger;
import com.godaddy.logging.LoggerFactory;
import java.util.UUID;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import uk.gov.ons.ctp.response.collection.exercise.lib.common.error.CTPException;
import uk.gov.ons.ctp.response.collection.exercise.message.dto.CollectionInstrumentMessageDTO;
import uk.gov.ons.ctp.response.collection.exercise.service.CollectionExerciseService;

@RestController
@RequestMapping(value = "/collection-instrument", produces = "application/json")
public class CollectionExerciseInstrumentReceiverEndpoint {
private static final Logger log =
LoggerFactory.getLogger(CollectionExerciseInstrumentReceiverEndpoint.class);
private CollectionExerciseService collectionExerciseService;

@Autowired
public CollectionExerciseInstrumentReceiverEndpoint(
CollectionExerciseService collectionExerciseService) {
this.collectionExerciseService = collectionExerciseService;
}

@RequestMapping(value = "/link", method = RequestMethod.POST)
public ResponseEntity<?> collectionInstrumentLink(
final @RequestBody @Valid CollectionInstrumentMessageDTO collectionInstrumentMessageDTO)
throws CTPException {
log.with(collectionInstrumentMessageDTO.getInstrumentId())
.with(collectionInstrumentMessageDTO.getExerciseId())
.info("Consumed message");

UUID collectionExerciseId = collectionInstrumentMessageDTO.getExerciseId();

collectionExerciseService.transitionScheduleCollectionExerciseToReadyToReview(
collectionExerciseId);
return ResponseEntity.ok().build();
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8a0c42a

Please sign in to comment.