Skip to content

Commit

Permalink
Merge pull request #214 from CJSCommonPlatform/extract-command-handle…
Browse files Browse the repository at this point in the history
…r-suspenders

Exctract the process suspenders for command handler into their own jar
  • Loading branch information
mapingo committed Jan 24, 2020
2 parents a0a8556 + db127ba commit d664759
Show file tree
Hide file tree
Showing 47 changed files with 77 additions and 307 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on [Keep a CHANGELOG](http://keepachangelog.com/). This project adheres to
[Semantic Versioning](http://semver.org/).

## [Unreleased]
## [2.4.7] - 2020-01-24
### Changed
- Event store now works with multiple event sources
- Event store now compatible with contexts that do not have a command pillar
- Extracted all command pillar SystemCommands into their own module

## [2.4.6] - 2020-01-21
### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?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">
<parent>
<artifactId>event-store-management</artifactId>
<groupId>uk.gov.justice.event-store</groupId>
<version>2.4.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>event-store-management-command-handler-extension</artifactId>

<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>uk.gov.justice.services</groupId>
<artifactId>framework-management</artifactId>
<version>${framework.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.event-store</groupId>
<artifactId>event-store-management-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.event-store</groupId>
<artifactId>event-store-util</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.event-store</groupId>
<artifactId>event-publisher-timer</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package uk.gov.justice.services.eventstore.management.shuttering.observers;
package uk.gov.justice.services.eventstore.management.extension.suspension;

import static java.lang.String.format;
import static uk.gov.justice.services.management.suspension.api.SuspensionResult.suspensionFailed;
import static uk.gov.justice.services.management.suspension.api.SuspensionResult.suspensionSucceeded;

import uk.gov.justice.services.eventsourcing.util.jee.timer.StopWatchFactory;
import uk.gov.justice.services.eventstore.management.shuttering.process.CommandHandlerQueueInterrogator;
import uk.gov.justice.services.management.suspension.api.Suspendable;
import uk.gov.justice.services.management.suspension.api.SuspensionResult;
import uk.gov.justice.services.management.suspension.commands.SuspensionCommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.gov.justice.services.eventstore.management.shuttering.process;
package uk.gov.justice.services.eventstore.management.extension.suspension;

import uk.gov.justice.services.common.polling.MultiIteratingPoller;
import uk.gov.justice.services.common.polling.MultiIteratingPollerFactory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.gov.justice.services.eventstore.management.shuttering.process;
package uk.gov.justice.services.eventstore.management.extension.suspension;

import uk.gov.justice.services.messaging.jms.JmsCommandHandlerDestinationNameProvider;
import uk.gov.justice.services.messaging.jms.JmsQueueBrowser;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Marker file indicating CDI should be enabled -->

<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="
http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd" bean-discovery-mode="all">
</beans>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package uk.gov.justice.services.eventstore.management.shuttering.observers;
package uk.gov.justice.services.eventstore.management.extension.suspension;

import static java.util.Optional.empty;
import static java.util.UUID.randomUUID;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.inOrder;
Expand All @@ -10,7 +11,6 @@
import static uk.gov.justice.services.jmx.api.domain.CommandState.COMMAND_FAILED;

import uk.gov.justice.services.eventsourcing.util.jee.timer.StopWatchFactory;
import uk.gov.justice.services.eventstore.management.shuttering.process.CommandHandlerQueueInterrogator;
import uk.gov.justice.services.management.suspension.api.SuspensionResult;
import uk.gov.justice.services.management.suspension.commands.SuspensionCommand;

Expand Down Expand Up @@ -50,7 +50,7 @@ public void shouldSuspendButNotUnsuspend() throws Exception {
@Test
public void shouldWaitForCommandHandlerQueueToDrainAndReturnSuccess() throws Exception {

final UUID commandId = UUID.randomUUID();
final UUID commandId = randomUUID();
final StopWatch stopWatch = mock(StopWatch.class);
final SuspensionCommand suspensionCommand = mock(SuspensionCommand.class);

Expand Down Expand Up @@ -79,7 +79,7 @@ public void shouldWaitForCommandHandlerQueueToDrainAndReturnSuccess() throws Exc
@Test
public void shouldReturnFailureIfQueueDoesNotDrainInTime() throws Exception {

final UUID commandId = UUID.randomUUID();
final UUID commandId = randomUUID();
final StopWatch stopWatch = mock(StopWatch.class);
final SuspensionCommand applicationShutteringCommand = mock(SuspensionCommand.class);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.gov.justice.services.eventstore.management.shuttering.process;
package uk.gov.justice.services.eventstore.management.extension.suspension;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package uk.gov.justice.services.eventstore.management.shuttering.process;
package uk.gov.justice.services.eventstore.management.extension.suspension;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
5 changes: 0 additions & 5 deletions event-store-management/event-store-management-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@
<artifactId>event-store-management-events</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.event-store</groupId>
<artifactId>event-publisher-timer</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>uk.gov.justice.event-store</groupId>
<artifactId>event-tracking-service</artifactId>
Expand Down
1 change: 1 addition & 0 deletions event-store-management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<module>event-store-management-core</module>
<module>event-store-management-events</module>
<module>event-store-management-commands</module>
<module>event-store-management-command-handler-extension</module>
</modules>

</project>

This file was deleted.

Loading

0 comments on commit d664759

Please sign in to comment.