Skip to content

Commit

Permalink
Various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tqvarnst committed Sep 16, 2018
1 parent 8036c3b commit 0a0c9a5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Expand Up @@ -118,7 +118,7 @@ private Completable initQueueEventsListener() {
queue
.stream()
.map(o -> (JsonObject) o)
.sorted((j1, j2) -> j2.getLong("enterTime").compareTo(j1.getLong("enterTime")))
.sorted((j1, j2) -> j2.getLong("enterQueueTime").compareTo(j1.getLong("enterQueueTime")))
.forEach(json -> {
String user = json.getString("name");
long enteredAt = json.getLong("enterQueueTime") * 1000; // UI expect milliseconds
Expand Down
Expand Up @@ -47,12 +47,7 @@ public void start(Future<Void> done) throws Exception {
Query query = queryFactory.from(User.class)
.having("rideId").eq("reactica")
.and()
.not(
queryFactory
.having("currentState").eq(User.STATE_RIDE_COMPLETED)
.and()
.having("completedRideTime").lt((Instant.now().toEpochMilli() / 1000) - 10*60)
)
.having("currentState").in(User.STATE_IN_QUEUE,User.STATE_ON_RIDE)
.orderBy("enterQueueTime", SortOrder.DESC)
.build();

Expand Down
Expand Up @@ -8,6 +8,7 @@
import org.apache.logging.log4j.Logger;
import org.infinispan.query.api.continuous.ContinuousQueryListener;

import java.time.Instant;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

Expand All @@ -31,7 +32,9 @@ private JsonObject generateOutput() {
}

private void fire() {
vertx.eventBus().send(CURRENT_LINE_EVENTS, generateOutput());
JsonObject users = generateOutput();
LOGGER.info("Send the following list of users to the eventBus at time( " + (Instant.now().toEpochMilli()/1000) + ") : " + users.encodePrettily());
vertx.eventBus().send(CURRENT_LINE_EVENTS, users);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion setup/openshift/install-is-and-templates.sh
Expand Up @@ -15,7 +15,7 @@ if $(oc get is/jboss-datagrid72-openshift -n openshift > /dev/null 2>&1); then
oc create -f https://raw.githubusercontent.com/jboss-container-images/jboss-amq-7-broker-openshift-image/amq-broker-71/amq-broker-7-image-streams.yaml -n openshift --as=system:admin
fi

oc -n openshift import-image jboss-amq-63:1.4 --as=system:admin > /dev/null && echo "jboss-amq-63:1.4 image successfully imported"
oc -n openshift import-image amq-broker-71-openshift:1.0 --as=system:admin > /dev/null && echo "amq-broker-71-openshift:1.0 image successfully imported"

info "### INSTALLING TEMPLATES FOR AMQ AND RDG"

Expand Down
5 changes: 4 additions & 1 deletion setup/redeploy.sh
Expand Up @@ -3,4 +3,7 @@
SCRIPT_DIR=$(dirname "$0")
ROOT_POM="${SCRIPT_DIR}/../pom.xml"

mvn -f "${ROOT_POM}" fabric8:undeploy -Popenshift && oc delete $(oc get pod -o name | grep eventstore-dg) && mvn -f "${ROOT_POM}" clean install fabric8:deploy -Popenshift
mvn -f "${ROOT_POM}" fabric8:undeploy -Popenshift && \
oc delete $(oc get pod -o name | grep eventstore-dg) && \
oc delete $(oc get pod -o name | grep eventstream-amq) && \
mvn -f "${ROOT_POM}" clean install fabric8:deploy -Popenshift

0 comments on commit 0a0c9a5

Please sign in to comment.